Fowlkes-Mallows Index Calculator
Inputs
- Inputs: 80 true positives, 20 false positives, 10 false negatives.
- Precision = TP / (TP + FP) = 0.8000; recall = TP / (TP + FN) = 0.8889.
- Fowlkes-Mallows = sqrt(precision x recall) = sqrt(0.7111) = 0.8433.
- For contrast, the harmonic-mean F1 score of the same table is 0.8421.
Two questions decide whether a classifier is doing its job: of the cases it flagged, how many were real - and of the real cases, how many did it flag? Precision answers the first, recall the second, and the Fowlkes-Mallows index fuses them into a single number as their geometric mean. Proposed by Fowlkes and Mallows in 1983 for comparing clusterings, it has become a standard classifier score in its own right. This calculator takes the three counts that define it - true positives, false positives and false negatives - and returns the index with precision, recall and the better-known F1 score shown for contrast.
Worked examples
Balanced classifier
(80 · 20 · 10)
| Fowlkes-Mallows index | 0.8433 |
| Precision | 0.8000 |
| Recall (sensitivity) | 0.8889 |
| F1 score (for contrast) | 0.8421 |
High precision, lower recall
(45 · 5 · 15)
| Fowlkes-Mallows index | 0.8216 |
| Precision | 0.9000 |
| Recall (sensitivity) | 0.7500 |
| F1 score (for contrast) | 0.8182 |
Noisy classifier
(120 · 60 · 30)
| Fowlkes-Mallows index | 0.7303 |
| Precision | 0.6667 |
| Recall (sensitivity) | 0.8000 |
| F1 score (for contrast) | 0.7273 |
A clustering index that became a classifier score
The index began life in cluster analysis. Fowlkes and Mallows wanted a number for the agreement between two ways of grouping the same objects, and they built it from pairs: of the pairs grouped together by both methods, measured against the pairs each method grouped alone. When the same mathematics is pointed at a classifier against the truth, the pair-counting collapses into the geometric mean of precision and recall - the form on this page. The migration is typical of good statistics: a measure built for one comparison turned out to be the natural measure of another.
Its geometric character is the point. An arithmetic mean of precision and recall lets one compensate for the other - flag everything and recall is perfect. A geometric mean refuses the bargain: it is dragged toward whichever of the two is weaker, and it is zero the moment either is zero. The classifier that flags everything scores its recall of 1 and a precision near the base rate, and the index reports the imbalance rather than averaging it away.
- The geometric mean of precision and recall
- Symmetric: swapping the two error types leaves it unchanged
- True negatives never enter it
- Originally a clustering-agreement index (1983)
Precision and recall, geometrically
The first example is a balanced classifier: 80 true positives against 20 false positives and 10 false negatives. Precision is 0.8000, recall is 0.8889, and the index is the square root of their product, 0.8433 - sitting between them, closer to the weaker precision, as a geometric mean always does. The second example trades the errors the other way: precision of 0.9000 against recall of 0.7500, and the index falls to 0.8216 despite the excellent precision, because the geometric mean prices the missed cases at full weight.
Symmetry is the index's signature. Swap false positives and false negatives - swap precision and recall - and the Fowlkes-Mallows value does not move. Whether that is a virtue depends on the application: for comparing clusterings it is exactly right, and for screening problems where a missed case and a false alarm genuinely cost the same it is defensible. Where the costs differ, no single symmetric number will serve, and the two components the calculator displays are the place to look.
Worked examples
Example 1: True positives 80; False positives 20; False negatives 10. Fowlkes-Mallows index = 0.8433. Supporting values: Precision 0.8000; Recall (sensitivity) 0.8889; F1 score (for contrast) 0.8421. Inputs: 80 true positives, 20 false positives, 10 false negatives. Precision = TP / (TP + FP) = 0.8000; recall = TP / (TP + FN) = 0.8889. Fowlkes-Mallows = sqrt(precision x recall) = sqrt(0.7111) = 0.8433. For contrast, the harmonic-mean F1 score of the same table is 0.8421.
Example 2: True positives 45; False positives 5; False negatives 15. Fowlkes-Mallows index = 0.8216. Supporting values: Precision 0.9000; Recall (sensitivity) 0.7500; F1 score (for contrast) 0.8182. Inputs: 45 true positives, 5 false positives, 15 false negatives. Precision = TP / (TP + FP) = 0.9000; recall = TP / (TP + FN) = 0.7500. Fowlkes-Mallows = sqrt(precision x recall) = sqrt(0.6750) = 0.8216. For contrast, the harmonic-mean F1 score of the same table is 0.8182.
Example 3: True positives 120; False positives 60; False negatives 30. Fowlkes-Mallows index = 0.7303. Supporting values: Precision 0.6667; Recall (sensitivity) 0.8000; F1 score (for contrast) 0.7273. Inputs: 120 true positives, 60 false positives, 30 false negatives. Precision = TP / (TP + FP) = 0.6667; recall = TP / (TP + FN) = 0.8000. Fowlkes-Mallows = sqrt(precision x recall) = sqrt(0.5333) = 0.7303. For contrast, the harmonic-mean F1 score of the same table is 0.7273.
FM vs the F1 score
The F1 score is the same fusion idea with a different mean: harmonic instead of geometric. On balanced performance the two nearly coincide - the first example's F1 is 0.8421 against an FM of 0.8433 - and they diverge exactly when precision and recall pull apart, the harmonic mean punishing imbalance harder. The third example shows the gap opening: precision of 0.6667 and recall of 0.8000 give an FM of 0.7303 and an F1 of 0.7273. Neither is the correct one; they are two conventions for the same discomfort with one-sided performance.
The honest reason to report FM alongside F1 is its second life: in clustering benchmarks the Fowlkes-Mallows index is the established external validation measure, computed from pair counts over whole partitions. A practitioner moving between the classification and clustering literatures meets the same index wearing both hats, and this calculator's contrast line exists so the relationship - geometric here, harmonic there, same numerator spirit - is visible rather than folklore.
Why true negatives are absent
Nothing in the formula counts a true negative. That absence is deliberate and is what makes the index usable on imbalanced problems: when negatives outnumber positives a hundred to one, a classifier can be nearly perfect on negatives by saying no to everything, and any measure that rewards true negatives - accuracy above all - will call that success. FM gives the say-nothing classifier a recall of zero and therefore an index of zero. The 120 true positives of the third example are scored against its 60 false alarms and 30 misses, and the thousands of correct rejections a real system would also have made simply do not enter.
The absence has a price. Two classifiers with identical positive-class behaviour and wildly different negative-class behaviour tie on FM, and in applications where false reassurance is cheap but alarm fatigue is real, that tie hides something. The index should therefore travel with its components - precision and recall are both on this page's output - and with a measure that does see the negatives, such as specificity or the Matthews correlation, when the negative class carries information worth scoring.
Threshold choice is where the index earns its keep in practice. A probabilistic classifier becomes a decision-maker at a cut-off, and sweeping that cut-off trades precision against recall along a curve. Because the geometric mean punishes whichever side is starved, the FM-maximising threshold tends to sit near the balance point of the two - in the first example's neighbourhood, where 0.8433 is achieved with precision and recall within a tenth of each other. Where the costs of the two errors are genuinely asymmetric, the sweep should be read directly rather than maximised blindly, but the index gives the sweep a principled default.
The clustering heritage also means the index is one of the few classifier scores with an exact chance-corrected cousin in routine use: the adjusted Rand index corrects a sibling measure for agreement expected by luck. FM itself is not chance-corrected, which is worth remembering when the positive class is common - a classifier can post a respectable FM partly on base rate alone. Reading it beside the raw counts, as this page's inputs force one to do, is the simplest protection: 80, 20 and 10 are on the table, and 0.8433 is their summary, not their substitute.
In short: give the calculator the three counts, and it returns the one number that refuses to let a classifier be good at only half its job - with the two halves, and the harmonic alternative, kept in view where they belong.
Reading the index
The scale runs from 0 to 1, with 1 reserved for a classifier with no errors of either counted kind. Working values in applied problems tend to live between 0.5 and 0.95, and the worked examples span the instructive part of that range: 0.8433 for a balanced classifier, 0.8216 for a precise but incomplete one, 0.7303 for a noisy one. Because the index is a geometric mean, equal proportional improvements in precision and recall are worth the same wherever they are earned - a property that makes it a clean target for threshold tuning, since moving a threshold trades one against the other along a curve the index summarises.
What the index cannot tell you is where the threshold should sit, or whether either error is affordable. It is a summary of a confusion matrix's positive row and column, nothing more - but summaries earn their keep by being comparable, and a single number that punishes one-sidedness, ignores the negative flood and matches a forty-year-old clustering standard is a summary with unusually good credentials. Report it with its two parents, precision and recall, and it will not mislead anyone.
FAQs
What Fowlkes-Mallows index does the first worked example give?
0.8433 - the square root of precision 0.8000 times recall 0.8889.
What is the precision in the first example?
0.8000: 80 true positives out of 100 flagged cases.
What is the recall in the first example?
0.8889: 80 of the 90 real cases were found.
What F1 score does the first example give for contrast?
0.8421. The harmonic mean sits just below the geometric mean when precision and recall are close.
What index does the high-precision second example give?
0.8216. Precision of 0.9000 cannot rescue recall of 0.7500 under a geometric mean.
What index does the noisy third example give?
0.7303, against an F1 of 0.7273 - the two means diverge as the errors grow lopsided.