| concordanceNetworkNMI {SNFtool} | R Documentation |
Given a list of affinity matrices, Wall, the number of clusters, return a matrix containing the NMIs between cluster assignments made with spectral clustering.
concordanceNetworkNMI(Wall, C)
Wall |
List of matrices. Each element of the list is a square, symmetric matrix that shows affinities of the data points from a certain view. |
C |
Number of clusters |
Returns an affinity matrix that represents the neighborhood graph of the data points.
Dr. Anna Goldenberg, Bo Wang, Aziz Mezlini, Feyyaz Demir
# How to use SNF with multiple views # Load views into list "dataL" data(dataL) data(label) # Set the other parameters K = 20 # number of neighbours alpha = 0.5 # hyperparameter in affinityMatrix T = 20 # number of iterations of SNF # Normalize the features in each of the views. #dataL = lapply(dataL, standardNormalization) # Calculate the distances for each view distL = lapply(dataL, function(x) dist2(x, x)) # Construct the similarity graphs affinityL = lapply(distL, function(x) affinityMatrix(x, K, alpha)) # an example of how to use concordanceNetworkNMI Concordance_matrix = concordanceNetworkNMI(affinityL, 3); ## The output, Concordance_matrix, ## shows the concordance between the fused network and each individual network.