Extrinsic Evaluation: Purity, ARI, and NMI
What Is Extrinsic Evaluation?
Extrinsic evaluation requires ground truth labels (gold-standard annotations). It measures how well the discovered clusters match the known true classes. There is no requirement that cluster labels match class label numbers; only that points from the same class tend to end up in the same cluster.
Purity
How It Works
- For each discovered cluster, find the majority true class among its members.
- Sum the counts of majority-class members across all clusters.
- Divide by the total number of points:
where is the set of points in discovered cluster , and is the set of points with true class .
Range and Interpretation
Purity ranges from 0 to 1, with 1 being perfect. Higher is better.
Critical Flaw
Purity is misleading. The trivial clustering where every point is its own singleton cluster achieves purity = 1 (each “cluster” has exactly one point, so the majority class is trivially 100%). This “perfect” score is meaningless. Purity rewards fragmentation; it does not penalise splitting true classes across multiple clusters.
Adjusted Rand Index (ARI)
How It Works
ARI considers every pair of points. For each pair, both the true labels and the discovered clustering either place the pair in the same group or different groups. This produces a 2x2 contingency table of agreements/disagreements. ARI corrects for the number of agreements expected by chance (much like Cohen’s ):
Range and Interpretation
ARI ranges from to :
- : perfect match with ground truth.
- : no better than random chance.
- : worse than random.
ARI is interpretable much like Cohen’s : it is chance-corrected and does not reward singleton clusters.
Normalised Mutual Information (NMI)
How It Works
NMI is information-theoretic. It measures how much knowing the discovered cluster assignment reduces uncertainty about the true class (mutual information), normalised to the range :
where is mutual information between cluster assignments and true classes , and is entropy. The denominator uses the arithmetic mean of the two entropies (other normalisation variants exist; the course does not require memorising the exact normalisation denominator).
Range and Interpretation
NMI ranges from 0 to 1, with 1 being perfect. NMI = 0 means the clustering tells you nothing about the true class (statistical independence).
Why NMI Is Preferred in MLRD
NMI handles chance correctly and does not reward singleton clusters (splitting each point into its own cluster gives NMI near 0, not 1). It is the MLRD course’s recommended extrinsic metric for this reason.
Comparison Table
| Metric | Range | Chance-Corrected? | Penalises Over-Fragmentation? | Best For |
|---|---|---|---|---|
| Purity | No | No (rewarded by it) | Quick sanity check only | |
| ARI | Yes | Yes | Balanced accuracy-like measure | |
| NMI | Yes | Yes | Preferred MLRD metric |
Worked Example
Suppose we have 6 points with true classes: . Discovered clustering gives .
Purity
- Cluster 1 contains: → majority class A, count = 2.
- Cluster 2 contains: → majority class B, count = 3.
Why Purity Fails
If we instead had (six singleton clusters), purity would be . This is the best possible purity score for the worst possible clustering. By contrast, both ARI and NMI would be near zero for singleton clusters.
Summary
| Aspect | Detail |
|---|---|
| Purity | Majority-class accuracy; flawed (rewards singletons) |
| ARI | Pairwise agreement corrected for chance; |
| NMI | Information-theoretic; ; preferred MLRD metric |
| Extrinsic requirement | Ground truth labels must exist |
| Key distinction | Intrinsic = no labels needed; Extrinsic = labels required |
Past paper questions: y2024p3q7e