Precision and Recall
Precision and recall are the most basic pair of evaluation metrics in binary classification and information retrieval. Precision answers "how many of the items I reported are correct", and recall answers "did I miss anything that should have been found". Together they characterize the model's trade-off among different error types and reflect the trade-offs in real business better than a single accuracy number.
Core Principles
Both are derived from the four cells of the confusion matrix. Let a true positive, TP, mean predicted positive and actually positive; a false positive, FP, mean predicted positive but actually negative; and a false negative, FN, mean predicted negative but actually positive. Precision is TP / (TP + FP), where the denominator is "all samples predicted positive"; recall is TP / (TP + FN), where the denominator is "all samples actually positive".
The denominators differ, and that is the root of the conflict. To push down false positives in the denominator, the model becomes more conservative and misses some true positives, so precision rises while recall falls; conversely, loosening the threshold raises recall but introduces more noise. This is the so-called precision-recall trade-off curve.
An intuitive example: among 100 patients, 10 actually have the disease. The model flags 20 as positive, hitting 8 of them. Precision is then 40 percent, meaning only two of every five flagged are correct; recall is 80 percent, meaning 8 of the 10 patients were found. The two numbers describe the same set of predictions under two denominators, and collapsing them into one number loses structural information.
Because the two usually move in opposite directions, a single metric alone is meaningless. The harmonic-mean F1 score combines them into one number and is more sensitive to the smaller value, preventing a case where one is extremely high and the other extremely low yet still scores well. For overall evaluation, average precision, AP, is also usually computed: the integral of precision over recall from 0 to 1, which does not depend on a specific threshold and is the standard metric in object detection, where mAP is the re-averaging of AP over multiple classes and intersection-over-union thresholds.
Key Points
Choosing a metric depends on business cost. In scenarios such as medical screening, fraud alerts, and security checks, the cost of a miss far exceeds that of a false alarm, so high recall should come first even at some loss of precision, because human review still backstops it. In scenarios such as spam blocking and legal document retrieval, false alarms make users lose trust outright, so high precision should come first.
In multiclass settings, macro averaging and micro averaging must be distinguished. Macro averaging computes per class and then averages, giving small classes the same weight as large ones; micro averaging pools the TP, FP, and FN of all classes before computing, so the result is dominated by the class with the most samples. When classes are highly imbalanced, macro averaging better exposes failures on small classes.
Threshold selection has its own criteria. A common method is to plot the precision-recall curve and find the maximum recall corresponding to the business's acceptable lower bound on precision, or to minimize expected loss directly against a cost function. If the model outputs probabilities, the threshold is itself the tunable parameter. After deployment, watch for distribution drift: the optimal threshold from training may not remain optimal on real traffic, and it should be recalibrated periodically with new samples.
Common Misconceptions
The most common is evaluating a highly imbalanced dataset by accuracy. With 100 samples containing only one positive, judging everything negative gives 99 percent accuracy but zero recall, and the model is useless. Another misconception is that F1 is always stricter than both, when in fact when precision and recall differ greatly, F1 is dragged down very low and instead obscures decent performance on one side. Some also ignore the denominators and mix up those of precision and recall, a mismatch especially common in cross-validation.
Application Scenarios
Disease screening, anti-fraud risk control, search engine ranking, the recall and ranking stages of recommender systems, mAP evaluation in object detection, anomaly detection, entity recognition in information extraction, blocking of violating content in content moderation, and defect recall in industrial quality inspection.