The four counts
| Predicted positive | Predicted negative |
|---|
| Actually positive | True positive | False negative |
| Actually negative | False positive | True negative |
Everything else is a ratio of these. The two that matter most divide by different denominators, which is exactly why they disagree.
Precision = TP / (TP + FP) — of everything you flagged, what fraction was right. The denominator is what *you* predicted, so precision is damaged by false alarms.
Recall = TP / (TP + FN) — of everything that was actually there, what fraction you caught. The denominator is what *reality* contained, so recall is damaged by misses.
Why they trade off
Drag the threshold to 0.10. Almost everything is flagged, so almost every real positive is caught and recall approaches 100%. But the flagged set is now full of negatives, and precision collapses.
Drag it to 0.90. Only the most confident cases are flagged, nearly all of them correct, and precision approaches 100%. But most real positives are below the line, and recall collapses.
You cannot maximise both by moving the threshold. The threshold only chooses where on the trade-off you sit. Improving both at once requires a better model — one whose two distributions overlap less.
Which one you want depends on the cost
The question is never "which metric is best". It is which mistake is more expensive.
Recall matters more when a miss is costly: screening for a serious disease, detecting fraud, finding safety defects. A false alarm costs a second look. A miss costs the thing you were trying to prevent.
Precision matters more when a false alarm is costly: flagging accounts for suspension, recommending content, sending an alert that wakes someone. Missing one is a shame. Being wrong repeatedly destroys trust in the system.
F1, and why it is a harmonic mean
F1 combines them:
F1 = 2 * precision * recall / (precision + recall)
That is the harmonic mean, and the choice of mean is the point. Take precision of 1.0 and recall of 0.01 — a model that flags exactly one case and gets it right. The arithmetic mean is 0.505, which sounds respectable. F1 is 0.0198.
The harmonic mean is pulled toward the smaller number, so it stays low unless both are high. That makes it hard to game with a degenerate model, which is precisely what a single summary number needs to be.
F1 weights the two equally, which is a decision and often the wrong one. F-beta lets you weight recall β times as much as precision; F2 favours recall, F0.5 favours precision. If you have a reason to prefer one, use it.
Why accuracy is on the readout and not in the headline
Accuracy is (TP + TN) / everything. It is the most intuitive metric and it is close to useless when the classes are unbalanced.
If 1% of transactions are fraudulent, predicting "never fraud" scores 99% accuracy while catching nothing at all. Precision and recall are both zero, which is the honest description. [Imbalanced data](precision_recall_vs_roc.html) is where this matters most.
Where it goes wrong
Reporting one number without the threshold. "Precision 0.9" is uninterpretable alone; at some threshold nearly every model achieves it.
Optimising F1 when the costs are not equal. F1 assumes they are.
Comparing models at 0.5. Two models can rank cases equally well and differ only in calibration. Compare across thresholds, or tune each one.
Accuracy on imbalanced data. It measures the class balance more than the model.