brainconn.clustering.agreement

agreement(ci, buffsz=1000)[source]

Takes as input a set of vertex partitions CI of dimensions [vertex x partition]. Each column in CI contains the assignments of each vertex to a class/community/module. This function aggregates the partitions in CI into a square [vertex x vertex] agreement matrix D, whose elements indicate the number of times any two vertices were assigned to the same class.

In the case that the number of nodes and partitions in CI is large (greater than ~1000 nodes or greater than ~1000 partitions), the script can be made faster by computing D in pieces. The optional input BUFFSZ determines the size of each piece. Trial and error has found that BUFFSZ ~ 150 works well.

Parameters:
  • ci (NxM numpy.ndarray) – set of M (possibly degenerate) partitions of N nodes
  • buffsz (int | None) – sets buffer size. If not specified, defaults to 1000
Returns:

D – agreement matrix

Return type:

NxN numpy.ndarray