Arte SheetsLearn. Try. Understand.

Machine Learning & Cluster Evaluation

Hubert-Arabie Adjusted Rand Index (ARI) Chance-Corrected Formula

Eliminate true-negative chance inflation in raw Rand cluster accuracy using the Hubert-Arabie (1985) Adjusted Rand Index pairwise formula in Excel and Arte Sheets.

Expose raw Rand Index inflation under random cluster assignments

The unadjusted Rand Index RI = (TP + TN) / (TP + FP + FN + TN) counts separated pairs TN alongside co-clustered pairs TP. Whenever two clusterings split items into 5–20 clusters, most random item pairs fall in different clusters by sheer chance, making even independent random labels score RI > 0.70! Hubert and Arabie (1985) subtract hypergeometric expected pair overlap so random independent partitions score exactly ARI = 0.

Test 100 item pairs by hand: TP = 20 (B2), FP = 10 (B3), FN = 15 (B4), TN = 55 (B5). Raw Rand Index is (20 + 55) / 100 = 0.7500. Using the exact pairwise Hubert-Arabie identity ARI = 2 * (TP*TN - FP*FN) / ((TP + FP)*(FP + TN) + (TP + FN)*(FN + TN)), numerator = 2 * (1,100 - 150) = 1,900 and denominator = 30*65 + 35*70 = 1,950 + 2,450 = 4,400, yielding ARI = 1,900 / 4,400 = 0.4318 (+0.3182 chance inflation removed!).

Similarity Metric (M = 100 Pairs)Pairwise FormulaSample Output
Unadjusted Rand Index RI(TP + TN) / (TP + FP + FN + TN)0.7500 (Inflated by TN = 55)
Expected Co-Clustered Pairs(TP + FP) * (TP + FN) / M10.5000 (30 * 35 / 100)
Hubert-Arabie Adjusted Rand ARI2*(TP*TN - FP*FN) / ((TP+FP)*(FP+TN) + (TP+FN)*(FN+TN))0.4318 (Exact 19 / 44)
Chance Independence CheckTP=12, FP=18, FN=28, TN=42 (TP*TN = FP*FN)RI = 0.5400 vs ARI = 0.0000

Hubert-Arabie Adjusted Rand Index (ARI) Formula

Guard the trivial single-cluster / all-singleton case where both TP*TN - FP*FN = 0 and the denominator = 0.

=LET(tp_p, B2, fp_p, B3, fn_p, B4, tn_p, B5, denom, (tp_p + fp_p) * (fp_p + tn_p) + (tp_p + fn_p) * (fn_p + tn_p), IF(denom <= 0, IF(fp_p + fn_p = 0, 1, "Degenerate Pairs"), ROUND(2 * (tp_p * tn_p - fp_p * fn_p) / denom, 4)))

Chance-Inflation Gap (RI minus ARI) Formula

Set B2:B5 to independent marginals 12, 18, 28, 42 (where 12 * 42 = 504 = 18 * 28): Raw Rand still reports 0.5400, whereas ARI drops cleanly to 0.

=ROUND((B2 + B5) / SUM(B2:B5), 4)

Try the example

Use the original values or change them to test your understanding.

Further reading