Glossary · Data Science & AI
Precision and Recall
Also called: precision · recall · sensitivity · F1 score
Precision is the share of predicted positives that are correct; recall is the share of actual positives the model finds.
Definition
Precision and recall evaluate classifiers when positives are rare or errors have different costs. Precision answers how many of the flagged cases are real, while recall, also called sensitivity, answers how many of the real cases were flagged. Raising the decision threshold usually increases precision and lowers recall, so the right balance depends on whether false alarms or misses are more expensive. The F1 score, the harmonic mean of the two, summarizes them in one number when they matter about equally.
Formula
TeX source
\text{Precision} = \frac{TP}{TP + FP}, \quad \text{Recall} = \frac{TP}{TP + FN}, \quad F_1 = \frac{2PR}{P + R}Worked example
Hypothetical: a lead-scoring model flags 200 leads as likely buyers; 120 of them buy, and 80 other leads also buy without being flagged. Precision is 120 / 200 = 60%, recall is 120 / 200 = 60%, and F1 is 60%.
Try it in a tool
Related terms
- Confusion Matrix: A table that counts a classifier's true positives, false positives, true negatives and false negatives, the basis for accuracy, precision and recall.
- Type I Error: Rejecting a null hypothesis that is actually true; concluding there is an effect when there is none.
- Type II Error: Failing to reject a null hypothesis that is actually false; missing an effect that really exists.
- Logistic Regression: A regression model for yes-or-no outcomes that predicts the probability of an event by passing a linear score through an S-shaped logistic function.
- Supervised Learning: Machine learning that trains a model on examples with known answers (labels) so it can predict the answer for new cases.