F1 combines precision and recall as 2 × precision × recall / (precision + recall). Google’s classification guide explains both the formula and why metric choice depends on the costs of false positives and false negatives (Google, Classification metrics). The equivalent count formula is 2TP / (2TP + FP + FN), which leaves out true negatives. F1 is a summary of precision and recall, not the percentage of all predictions that are correct.
For a concrete example, suppose a ticket classifier flags 100 tickets for escalation and 80 truly need it. Precision is 80/100 = 0.8. If 100 tickets in the whole test set need escalation, recall is also 0.8 and F1 is 0.8. If the system instead flags only 50 tickets and 40 are correct, precision stays at 0.8, recall falls to 0.4 and F1 falls to about 0.53.
Discussing what constitutes an acceptable evaluation score for a product, Greg Statton says, “you have to understand the end use” (episode 27, 30:30).
For builders, decide whether a missed escalation and an unnecessary escalation have equal costs before using F1 as your main score. Keep the underlying counts visible and state which class you measure. Precision and recall explains the two components; AI agent metrics beyond accuracy covers measurement beyond a single classification score.
Move the threshold, inspect the mistakes
Twelve invented messages, five actually spam. A message is flagged when its score is at least the threshold, including ties. Scores here are illustrative, not calibrated probabilities.
The worked example uses a threshold of 0.50. With JavaScript enabled, you can change it below.
6 of 12 messages flagged: 4 spam caught, 2 false alarms, 1 spam missed.
| Actual spam | Actual not spam | |
|---|---|---|
| Flagged | 4Correct flags (TP) | 2False alarms (FP) |
| Not flagged | 1Missed spam (FN) | 5Correct rejections (TN) |
- Precision
- 66.7%4 / 6 · correct among flagged
- Recall
- 80.0%4 / 5 · caught among actual spam
- F1
- 72.7%8 / 11 · 2TP / (2TP + FP + FN)
Nothing is flagged, so precision is undefined (0 / 0). Recall and F1 are zero for these five actual spam messages.
Inspect all 12 scored messages
| Message | Score | Actual label | Decision |
|---|---|---|---|
| A | 0.95 | Spam | Flagged (TP) |
| B | 0.90 | Spam | Flagged (TP) |
| C | 0.80 | Not spam | False alarm (FP) |
| D | 0.70 | Spam | Flagged (TP) |
| E | 0.50 | Spam | Flagged (TP) |
| F | 0.50 | Not spam | False alarm (FP) |
| G | 0.40 | Spam | Missed spam (FN) |
| H | 0.35 | Not spam | Not flagged (TN) |
| I | 0.30 | Not spam | Not flagged (TN) |
| J | 0.20 | Not spam | Not flagged (TN) |
| K | 0.10 | Not spam | Not flagged (TN) |
| L | 0.05 | Not spam | Not flagged (TN) |
Can lowering the threshold improve precision and recall together?
Yes. Here, moving from 0.50 to 0.40 catches message G, which is spam, without adding a false alarm. Precision rises from 4/6 to 5/7, and recall rises from 4/5 to 5/5. The tradeoff is common, but precision need not fall at every step.
F1 weights precision and recall equally; it does not encode the cost of a false alarm or a miss. Formulas: Google’s classification metrics guide. How thresholds work.
Sources
- Google, Classification metrics — Primary source for the explanation and distinctions in this entry.