Learn R Programming

NetComp (version 1.6)

netVal: Network Validation

Description

Returns vector with the True Positives, True Negatives, False Postives, False Negatives, the Adjusted Rand Index, and the Balanced Accuracy of the test network (matrix2) compared to the true network (matrix1). Network communities are based on hierachical clustering, with communities defind by k or h.

Usage

netVal(matrix1, matrix2, method='ward', k=200, h=NULL,...)

Arguments

matrix1
Adjacency matrix containing the true topology
matrix2
Adjacency matrix containing the test topology
method
Hierarchical clustering method to be passed to hclust.
k
Number of groups. Passed to cutree
h
Heights where tree is to be cut. Passed to cutree
...
Other parameters.

Value

netVal returns an vector with values True Positives, True Negatives, False Postives, False Negatives, Adjusted Rand Index, and Balanced Accuracy.

Details

The input matrices must be square but do not need to contain the same edges.

See Also

hclust{cutree}

Examples

Run this code
 #using the state.x77 and USArrest datasets
 arrestCor<-cor(t(USArrests))
 stateCor<-cor(t(state.x77))
 netVal(stateCor, arrestCor, method='ward', k=10)
 netVal(stateCor, stateCor, method='ward', k=10)

Run the code above in your browser using DataLab