F1 Score · Model Evaluation
F1 = Harmonic mean of Precision and Recall — punishes extreme imbalance between the two
Harmonic mean is low if EITHER value is low — you cannot compensate low recall with high precision
F
F1 formula — 2 × (P × R) / (P + R)
F1 combines precision and recall into a single number using the harmonic mean formula: 2 times (precision times recall), divided by (precision plus recall).
Example: a model with precision 0.9 and recall 0.9 would have an F1 score around 0.9, reflecting strong performance on both metrics.
1
Punishing imbalance — low value drags the score down
Unlike a simple average, the harmonic mean is disproportionately dragged down if EITHER precision or recall is low — you cannot hide a poor recall behind an impressively high precision, or vice versa.
Example: a model with 99% precision but only 10% recall would have a simple average around 55%, but its F1 score would be much lower, closer to 18%, reflecting how badly the low recall actually hurts overall performance.
β
F-beta — adjusting emphasis toward precision or recall
The F-beta score generalizes F1, allowing you to weight recall more heavily (beta greater than 1, common in medical contexts) or precision more heavily (beta less than 1) depending on which error type matters more for your specific application.
Example: a medical diagnosis system might use F2 (beta=2) to specifically emphasize recall, reflecting that missed diagnoses are more costly than false alarms in that context.
1
A model achieves 99% precision but only 10% recall on a fraud detection task.
2
Ask: does a simple average of precision and recall (around 55%) fairly represent this model's real-world usefulness? No — it's missing 90% of actual fraud cases, which is a severe problem the simple average masks.
3
Calculating the F1 score (the harmonic mean) instead produces a much lower score, closer to 18%, correctly reflecting how badly the poor recall actually hurts the model's real usefulness.
4
This is exactly why F1 is preferred over a simple average when you need a single number that fairly represents both precision and recall — it won't let an extreme imbalance hide behind one strong metric.

Exams test whether you understand WHY the harmonic mean is used instead of a simple average — specifically because it punishes extreme imbalance between precision and recall, unlike a simple average which can be misleadingly inflated by one very high value. Also expect questions on F-beta and when to use beta values above or below 1.

The most common trap is calculating a simple average of precision and recall instead of the harmonic mean, and assuming they'd give roughly the same result. They do NOT — the harmonic mean specifically punishes cases where one value is much lower than the other, which a simple average masks.

1. What is the formula for F1 score?
2 × (Precision × Recall) / (Precision + Recall) — the harmonic mean of precision and recall.
Tap to reveal / hide
2. Why is the harmonic mean used instead of a simple average?
Because it punishes extreme imbalance between precision and recall, preventing one high value from masking a very low value in the other.
Tap to reveal / hide
3. What would F1 look like for a model with 99% precision but only 10% recall?
Much lower than a simple average would suggest — closer to 18%, correctly reflecting the severe recall problem.
Tap to reveal / hide
4. What does an F-beta with beta greater than 1 emphasize?
Recall — often used in medical contexts where missed detections are especially costly.
Tap to reveal / hide
5. What does an F-beta with beta less than 1 emphasize?
Precision — used when false alarms are especially costly relative to missed detections.
Tap to reveal / hide