Machine Learning & Cluster Evaluation
Fowlkes-Mallows Clustering Index Formula vs Pairwise F1 and Jaccard
Evaluate clustering partitions in Excel and Arte Sheets using the Fowlkes-Mallows geometric mean of pairwise precision and recall TP / SQRT((TP + FP) * (TP + FN)).
Compare geometric Fowlkes-Mallows against harmonic F1 and Jaccard by hand
When comparing an algorithm’s clustering against ground-truth labels across all N*(N - 1)/2 item pairs, TP counts pairs placed together in both partitions, FP counts pairs merged only by the algorithm, FN counts true pairs split by the algorithm, and TN counts pairs separated in both (which inflates raw Rand accuracy when clusters are many). Fowlkes and Mallows (1983) ignore TN and take the geometric mean of Wallace’s directional co-membership rates.
Test hand-checkable pair counts: TP = 36 (B2), FP = 12 (B3), FN = 39 (B4), TN = 103 (B5). Pairwise precision is 36 / (36 + 12) = 36 / 48 = 0.7500; pairwise recall is 36 / (36 + 39) = 36 / 75 = 0.4800. Because 48 * 75 = 3,600, Fowlkes-Mallows is FM = 36 / SQRT(3,600) = 36 / 60 = 0.6000! Compare harmonic Pairwise F1 = 72 / 123 = 0.5854 (< 0.6000 by the HM-GM inequality) and Pairwise Jaccard = 36 / 87 = 0.4138.
| Pairwise Metric | Formula Expression | Sample Output |
|---|---|---|
| Wallace Precision B1 | TP / (TP + FP) = 36 / 48 | 0.7500 |
| Wallace Recall B2 | TP / (TP + FN) = 36 / 75 | 0.4800 |
| Fowlkes-Mallows Index FM | TP / SQRT((TP + FP) * (TP + FN)) | 0.6000 (Exact 36 / 60) |
| Pairwise F1 & Jaccard | 2*TP/(2*TP+FP+FN) vs TP/(TP+FP+FN) | 0.5854 vs 0.4138 |
Fowlkes-Mallows Index Formula
Guard degenerate singleton or all-merged partitions where TP + FP = 0 or TP + FN = 0 before taking the square root.
=LET(tp_p, B2, fp_p, B3, fn_p, B4, n_pred, tp_p + fp_p, n_true, tp_p + fn_p, IF(OR(n_pred <= 0, n_true <= 0), "Degenerate Partition", ROUND(tp_p / SQRT(n_pred * n_true), 4)))True-Negative Invariance & HM-GM Gap Formula
Verify two structural properties: first, FM - F1 >= 0 with equality if and only if FP = FN (set B4 = 12 -> both FM and F1 equal 36 / 48 = 0.7500); second, multiplying TN (B5) from 103 to 10,000 leaves FM completely unchanged at 0.6000.
=ROUND(2 * B2 / (2 * B2 + B3 + B4), 4)Try the example
Use the original values or change them to test your understanding.