new_modularity: Calculate the modularity

Description Usage Arguments Value Author(s) Examples

View source: R/new_modularity.R

Description

A function to calculate the modularity for weighted graph

Usage

1
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

1
2
3
4
5
6
7
8
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)

M2SMF documentation built on Jan. 11, 2020, 9:28 a.m.