pub enum CommunityComparison {
VariationOfInformation,
NormalizedMutualInformation,
SplitJoin,
Rand,
AdjustedRand,
}Expand description
Which partition-comparison measure compare_communities returns.
Mirrors igraph_community_comparison_t.
Variants§
VariationOfInformation
Variation of information (Meilă 2003) — distance in [0, log n].
VI = H(C1) + H(C2) − 2·I(C1, C2).
Lower means more similar; 0 iff partitions are identical.
NormalizedMutualInformation
Normalized mutual information (Danon et al. 2005) —
similarity in [0, 1]. NMI = 2·I(C1, C2) / (H(C1) + H(C2)).
Higher means more similar; 1 iff partitions are identical.
Defined as 1 when both partitions have a single cluster.
SplitJoin
Split-join distance (van Dongen 2000) — sum of the two
projection distances. Distance in [0, 2·(n − 1)]. Lower
means more similar; 0 iff partitions are identical.
Rand
Rand index (Rand 1971) — similarity in [0, 1]. Fraction
of vertex pairs the two partitions agree on (either both
together or both apart). Requires n ≥ 2.
AdjustedRand
Adjusted Rand index (Hubert & Arabie 1985) — similarity in
[-1, 1], chance-corrected. 0 means the partitions agree no
more than two random partitions of the same shape would.
Requires n ≥ 2. Degenerate inputs where both partitions are
all-one-cluster or all-singletons return 1.0 (sklearn
convention; the C reference’s formula would otherwise yield
0/0).
Trait Implementations§
Source§impl Clone for CommunityComparison
impl Clone for CommunityComparison
Source§fn clone(&self) -> CommunityComparison
fn clone(&self) -> CommunityComparison
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more