Precision and Recall
Precision measures how many of the items the model labeled as positive are actually positive, while recall measures how many of the actual positives the model found.
Key takeaways
- Precision measures correctness among predicted positives; recall measures coverage of actual positives.
- Improving one usually reduces the other.
- The right balance depends on whether false positives or false negatives are more costly.
Precision is the ratio of true positives to all predicted positives. Recall is the ratio of true positives to all actual positives. Together they describe the trade-off between false positives and false negatives for any binary classifier.
That trade-off matters because minimizing one metric usually maximizes the other. Spam filters need high precision to avoid putting legitimate email in the junk folder. Medical screening needs high recall to avoid missing sick patients. Neither metric tells the whole story alone, which is why they are usually reported together or combined into F1 score.
Think of it like this. Think of a librarian searching for science fiction books. Precision is how many of the books they handed you were actually science fiction. Recall is how many science fiction books in the library they found at all.
How it works
True positives are correctly predicted positives. False positives are negatives incorrectly labeled as positives. False negatives are positives incorrectly labeled as negatives. Precision divides true positives by all predicted positives. Recall divides true positives by all actual positives. Adjusting the classification threshold shifts the balance between them.
Common mistakes
"High accuracy means the model is good." Accuracy is misleading on imbalanced datasets where predicting the majority class scores high. "Precision and recall are the same thing." They measure opposite error types. "Perfect recall is always best." Perfect recall with low precision means flooding the user with false alarms.
Trade-offs
Precision and recall are simple and interpretable, but threshold-dependent. The right balance depends on the cost of false positives versus false negatives in the specific application.