split_join_distance#
- graph_tool.inference.split_join_distance(x, y)[git][source]#
Returns the split-join distance between two partitions.
- Parameters:
- xiterable of
intvalues orPropertyMap First partition.
- yiterable of
intvalues orPropertyMap Second partition.
- xiterable of
- Returns:
- d
int The split-join distance.
- d
See also
rand_indexRand index between partitions
variation_informationVariation of information between partitions
reduced_mutual_informationReduced mutual information between partitions
partition_overlapMaximum overlap between partitions
Notes
The split-join distance [dongen-performance-2000] is the number of elements that must be moved to transform one partition into the other, when the groups may only be split or joined,
\[d(\boldsymbol x,\boldsymbol y) = 2N - \sum_r\max_s n_{rs} - \sum_s\max_r n_{rs},\]where \(n_{rs}\) is the number of elements in group \(r\) of \(\boldsymbol x\) and group \(s\) of \(\boldsymbol y\), i.e. the sum of the “projection distances” \(N - \sum_r\max_s n_{rs}\) and \(N - \sum_s\max_r n_{rs}\) of each partition onto the other. This algorithm runs in time \(O(N)\).
References
[dongen-performance-2000]Stijn van Dongen, “Performance criteria for graph clustering and Markov cluster experiments”, Technical Report INS-R0012, Centrum voor Wiskunde en Informatica (2000).
Examples
>>> x = [0, 0, 0, 1, 1, 1] >>> y = [0, 0, 1, 1, 2, 2] >>> print(gt.split_join_distance(x, y)) 3