F1 score
In one sentence The F1 score folds precision and recall into one number, and it stays low unless both are good.
Updated
The F1 score combines precision and recall into a single number that is only high when both are high.
It works like rating a restaurant on food and hygiene. A place with brilliant food and a filthy kitchen should not average out to "pretty good" — one bad half should drag the whole rating down. F1 behaves that way on purpose.
Mathematically, F1 is the harmonic mean: F1 = 2 × (precision × recall) ÷ (precision + recall). A harmonic mean punishes imbalance. Precision of 1.0 with recall of 0.1 gives an F1 of 0.18, not the 0.55 a plain average would show.
precision recall plain average F1
0.9 0.9 0.90 0.90
1.0 0.1 0.55 0.18 ← the useless model is exposedUse F1 when the classes are imbalanced and you need one number to compare models. Its weakness: it hides which half is failing, and it ignores true negatives entirely. Look at precision and recall separately before trusting it.
Where to go next
- Full lesson: Model evaluation
- Related terms: precision, recall, accuracy, roc-auc