netneurotools.modularity.get_modularity

netneurotools.modularity.get_modularity(adjacency, comm, gamma=1)[source]

Calculate modularity contribution for each community in comm.

Parameters:
  • adjacency ((N, N) array_like) – Adjacency (e.g., correlation) matrix

  • comm ((N,) array_like) – Community assignment vector splitting N subjects into G groups

  • gamma (float, optional) – Resolution parameter used in original modularity maximization. Default: 1

Returns:

comm_q – Relative modularity for each community

Return type:

(G,) ndarray