new_modularity {M2SMF} | R Documentation |
Calculate the modularity
Description
A function to calculate the modularity for weighted graph
Usage
new_modularity(init_list, WL)
Arguments
init_list |
A list with N+2 elements, the former N as modality private sub-matrices, the Nth as the shared sub-matrix and the last one as the current loss |
WL |
A list of similarity matrices |
Value
A single value indicating the mudularity of current factorization and clustering
Author(s)
Xiaoyao Yin
Examples
WL <- simu_data_gen()
WL[[1]] <- affinityMatrix(dist2eu(Standard_Normalization(WL[[1]]),Standard_Normalization(WL[[1]])))
WL[[2]] <- affinityMatrix(dist2eu(Standard_Normalization(WL[[2]]),Standard_Normalization(WL[[2]])))
new_WL_list <- initialize_WL(WL)
init_list <- initialization(new_WL_list,5)
res <- M2SMF(WL,0.25,10^-4,5)
init_list <- res[[1]]
modularity <- new_modularity(init_list,WL)
[Package M2SMF version 2.0 Index]