What is the F1 score?
The F1 score is the harmonic mean of precision and recall. It compresses the two most common classifier metrics into one number between zero and one. The formula is two times precision times recall, divided by precision plus recall. A model with precision of 0.90 and recall of 0.90 has an F1 of 0.90. A model with precision of 0.90 and recall of 0.10 has an F1 of only 0.18.
The harmonic mean is chosen deliberately. An ordinary average of 0.90 and 0.10 would give 0.50, which flatters a model that misses nine out of ten real cases. The harmonic mean drags the result toward the weaker of the two, so a good F1 requires both precision and recall to be reasonable at the same time.
Why the F1 score matters
F1 is useful when the positive class is rare and accuracy is therefore misleading. In a legal document review where one document in fifty is privileged, a model that marks everything non-privileged is 98 percent accurate and completely useless. Its F1 on the privileged class is zero, which tells the truth. F1 is also the usual yardstick for comparing models or thresholds when the team has not yet agreed on the exact cost of a miss versus a false alarm.
F1 has limits. It weights precision and recall equally, which is rarely the real business trade-off. The F-beta family fixes this: F2 weights recall twice as heavily, and F0.5 favors precision. For problems with several classes, macro F1 averages the per-class scores and micro F1 pools all predictions, and the two can differ sharply when classes are unbalanced.
F1 score in practice
A law firm trains a model to flag privileged documents during discovery. The review partner cares most about missed privileged documents, which could be produced to the other side by mistake. The team therefore reports F2 rather than F1 and tunes the threshold on it. Precision stayed acceptable because a second-pass reviewer clears every flagged document.
What to watch for
- Ask for precision and recall separately, because the same F1 can come from very different combinations of the two.
- Confirm which class the F1 was computed on, since the score for the rare class is usually the one that matters.
- For multi-class models, ask whether a quoted F1 is macro or micro averaged.
- Consider an F-beta score instead when a miss and a false alarm clearly have different costs.