brainconn.modularity
.link_communities¶
-
link_communities
(W, type_clustering='single')[source]¶ The optimal community structure is a subdivision of the network into nonoverlapping groups of nodes which maximizes the number of within-group edges and minimizes the number of between-group edges.
This algorithm uncovers overlapping community structure via hierarchical clustering of network links. This algorithm is generalized for weighted/directed/fully-connected networks
Parameters: - W (NxN np.array) – directed weighted/binary adjacency matrix
- type_clustering (str) – type of hierarchical clustering. ‘single’ for single-linkage, ‘complete’ for complete-linkage. Default value=’single’
Returns: M – nodal community affiliation matrix.
Return type: CxN
numpy.ndarray