What are Precision and Recall?
Answer
Precision and recall are two fundamental metrics for evaluating classification models, especially with imbalanced data or asymmetric error costs. Precision (positive predictive value) is the ratio of correctly predicted positives to all predicted positives: it answers “when the model says positive, how often is it right?” If a spam detector flags 100 emails and 99 are truly spam, precision is 99%. Recall (sensitivity, true positive rate) is the ratio of correctly predicted positives to all actual positives: it answers “of all the real positives, how many did the model catch?” If 100 spam emails exist and the model finds 90, recall is 90%. High precision means few false alarms (a spam filter that almost never marks good mail as spam); high recall means few misses (a cancer screening that almost never misses a real case). The two metrics sit on a trade-off controlled by the decision threshold.
(1) Precision = Accuracy Of Positive Predictions: Minimizing false positives matters when false alarms are costly.
(2) Recall = Coverage Of Actual Positives: Minimizing false negatives matters when misses are costly.
(3) Trade-Off: Lowering the classification threshold raises recall and usually lowers precision; raising it does the reverse.

Figure 1: The set view: precision is the share of the retrieved set that is correct, recall is the share of the relevant set that was retrieved.
Mathematical Formulation:
Where:
(true positives) is the count of positives correctly predicted as positive.
(false positives) is the count of negatives wrongly predicted as positive, the false alarms.
(false negatives) is the count of positives wrongly predicted as negative, the misses.
(true negatives) is the count of negatives correctly predicted as negative; it enters neither formula, which is why these metrics shine on imbalanced data.
Leave a Reply