brainconn.modularity
.modularity_und_sign¶
-
modularity_und_sign
(W, ci, qtype='sta')[source]¶ This function simply calculates the signed modularity for a given partition. It does not do automatic partition generation right now.
Parameters: - W (NxN
numpy.ndarray
) – undirected weighted/binary connection matrix with positive and negative weights - ci (Nx1
numpy.ndarray
) – community partition - qtype (str) – modularity type. Can be ‘sta’ (default), ‘pos’, ‘smp’, ‘gja’, ‘neg’. See Rubinov and Sporns (2011) for a description.
Returns: - ci (Nx1
numpy.ndarray
) – the partition which was input (for consistency of the API) - Q (float) – maximized modularity metric
Notes
uses a deterministic algorithm
- W (NxN