When do you prefer precision over recall?
Model answer
Precision is the share of predicted positives that are truly positive: TP / (TP + FP). Recall is the share of actual positives the model finds: TP / (TP + FN). Raising the decision threshold usually raises precision and lowers recall, and the reverse.
Prefer precision when a false positive is expensive. Examples: a spam filter that sends real email to the spam folder, a recommendation that must be right, or a system that automatically blocks accounts.
Prefer recall when a false negative is expensive. Examples: cancer screening, fraud detection, or security alerts, where missing a real case is worse than a false alarm that a human can check.
When both matter, use the F1 score (harmonic mean) or the precision-recall curve to pick a threshold. With imbalanced classes, accuracy is misleading: a model that always predicts the majority class can score 99 percent accuracy and find nothing.
Key points
- Precision = TP / (TP + FP); recall = TP / (TP + FN)
- Favor precision when false positives are costly
- Favor recall when missing a real case is costly
- Threshold trades one for the other; accuracy misleads on imbalanced data
Likely follow-ups
- How would you choose a threshold in production?
- What does the ROC AUC measure and when is PR AUC better?
Common mistakes
- Using accuracy on a heavily imbalanced dataset
- Mixing up which of FP or FN each metric penalizes