ari(primary_partition: Dict[Any, int], test_partition: Dict[Any, int]) → float[source]¶
Given two partition schemas, a primary partition mapping (the most accurate representation of truth) and the test partition mapping (to be scored against that accurate representation of truth), calculate the Adjusted Rand Index.
int] primary_partition (Dict[Any,) – The most accurate representation of truth for cluster or community membership of nodes. The keys are vertex labels and the values are the cluster/community/partition labels.
int] test_partition (Dict[Any,) – The partition mapping to compare against the primary partition. The keys are vertex labels and the values are the cluster/community/partition labels.
The adjusted rand index for the two mappings
- Rtype float
ValueError – If the primary partition and test partition do not have an identical vertex label set.