F1 Score
The harmonic mean of precision and recall — the default single number for classification, and it encodes a decision nobody made.
When not to use it
- When your error costs are asymmetric. Which is nearly always. Use F-beta and state the ratio.
- To decide what to deploy. It's a comparison scalar, not a decision.
- Micro-averaged, on single-label multi-class. That's accuracy with a fancier name.
- When the negative class matters. F1 ignores true negatives entirely.
Reach for something else instead
- F-beta — the same metric with the weighting stated.
F2for recall,F0.5for precision. - Cost-weighted error — the confusion matrix times what each mistake costs. The honest version.
- Macro-F1 — if you must have one number on imbalanced multi-class, this is the one that notices the rare class.
- Precision and recall, separately — two numbers, no hidden assumption.
Sources & further reading
- van Rijsbergen (1979), Information Retrieval — where the F-measure comes from, and it was parameterised by β from the start. The β got dropped, not the concept.
- Hand & Christen (2018), A Note on Using the F-Measure for Evaluating Record Linkage Algorithms — F1 applies different implicit cost ratios to different classifiers.
- Powers (2011), Evaluation: From Precision, Recall and F-Measure to ROC, Informedness, Markedness & Correlation — what F1 discards, catalogued.
Primary sources, listed so you can check the claims on this page rather than take them on trust.
Where people go wrong
- Reporting F1 without being able to justify equal weighting. It's a default, not a decision.
- Not saying which averaging you used. Macro and micro can differ by tens of points.
- Reporting micro-F1 on single-label multi-class as if it weren't accuracy.
- Forgetting F1 ignores true negatives, then using it on a heavily imbalanced problem.