- Introduced by
- Historical statistical foundations
- Year
- 20th century
- Type
- Evaluation metric
- Family
- Classification Metric
What does it do?
Precision measures the proportion of positive predictions that were actually correct.
It answers the question: 'Of all the cases we predicted as positive, how many were truly positive?' Precision is critical in scenarios where false positives are costly.
The intuition behind the method
Precision concerns the quality of positive predictions. A high-precision classifier makes few false positive errors, so a positive prediction from it is more likely to be correct. Precision is usually read alongside recall, which asks whether the positive cases were found. The two tend to be inversely related: it is often possible to increase one at the cost of the other. A model that predicts positive only when very confident may have high precision and low recall, while a model that flags many cases finds more true positives but also more false alarms. Because precision depends on the decision threshold, which changes both TP and FP, a precision value should be reported at a stated operating point. Alternatively, precision values can be compared at a fixed recall level, for example at a recall of 0.75. Because precision uses only the positive predictions, it says nothing about how negative cases are handled.
History
Precision is the ratio of true positives to all positive predictions, TP / (TP + FP). It is widely used in information retrieval and machine learning, usually together with recall. Standard references that define it and discuss its relation to recall, the F measure and ROC analysis include Han, Kamber and Pei's data mining text and Powers (2011).
When to use it
Choose precision when the question is how reliable a positive prediction is, and when acting on a false positive is costly. Typical settings are binary classification tasks in which each positive prediction triggers an action or review, such as spam filtering, where legitimate email wrongly filtered is a cost to the user, or content moderation. Do not rely on precision alone when missing positive cases is the main concern, as in cancer screening; there, pair it with recall or use a measure that accounts for missed cases. Compare models at the same threshold or at a fixed recall level. Precision also depends on how common the positive class is, so precision values from datasets with different class prevalence are not directly comparable.
Limitations and considerations
- Ignores false negatives; a model could have high precision while missing many positive cases.
- Can be artificially high if the model is overly conservative (makes very few positive predictions), and is undefined if it makes none.
- Does not use true negatives, so it says nothing about how negative cases are handled, and it depends on how common the positive class is. It does not encode the relative costs of false positives and false negatives; those must be weighed separately.
- Alone, precision is incomplete without considering recall.
- Depends on the classification threshold, so a single value describes only one operating point.
- For multi-class problems, precision is computed per class and then averaged (for example macro or micro averaging); a single reported value is ambiguous unless the averaging choice is stated.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Directly measures confidence in positive predictions; high precision means positive predictions are reliable.
- Interpretable: precision = 1.0 means all positive predictions were correct.
- Essential for applications where false positives have high cost or social impact.
- Complements recall to give a complete picture of classification performance.
Applications
- Spam and email filtering, where false positives (filtering legitimate emails) create user frustration.
- Malware detection systems, where false positives (flagging safe files as malicious) disrupt operations.
- Loan approval systems, where false positives (approving risky applicants) create financial risk.
- Medical test interpretation, where false positives (diagnosing healthy patients as sick) lead to unnecessary treatment.
How it works
How it works
Count the number of true positives (correctly predicted positive cases) and false positives (negative cases incorrectly predicted as positive) at a fixed classification threshold.
Divide the count of true positives by the sum of true positives and false positives: precision = TP / (TP + FP). Worked example: a classifier labels 230 tuples as the positive class, of which 90 are truly positive (TP = 90) and 140 are not (FP = 140). Precision = 90 / 230 = 39.13%. In the same example, recall is 90 / 300 = 30.00%, since 300 tuples are actually positive.
Formula
\text{Precision} = \frac{TP}{TP + FP}Precision ranges from 0 to 1. A precision of 1.0 means every positive prediction was correct; a precision of 0 means none of the positive predictions were correct. If the model makes no positive predictions at all (TP + FP = 0), precision is undefined, because the denominator is zero. Report this case explicitly rather than treating it as 0 or 1. Precision is computed only from the positive predictions, so it does not indicate how many actual negatives were correctly identified, nor how many actual positives were missed.
Common pitfalls
- Optimizing precision without considering recall, leading to a model that makes very few positive predictions but claims high precision.
- Confusing precision with accuracy; precision is about positive predictions only, while accuracy is overall correctness.
- Reading precision as a measure of model quality on rare-positive problems without checking prevalence. For a fixed false positive rate, precision typically falls as the positive class becomes rarer, because false positives then outnumber true positives. A precision value from one dataset may therefore not transfer to another with different prevalence.
- Comparing precision values obtained at different thresholds or different recall levels, or treating an undefined precision (no positive predictions) as 0 or 1.
Frequently asked questions
When should I prioritize precision over recall?
Prioritize precision when the cost of a false positive is high. In spam filtering, a false positive wastes user time and trust. In medical screening for expensive treatments, a false positive leads to unnecessary medical procedures. In contrast, for cancer screening tests, recall is often more important because missing a cancer case is very costly.
Can a model have high precision but low recall?
Yes. A model could predict positive only in cases where it is very confident, correctly predicting few cases (high precision) but missing many actual positive cases (low recall). This is a conservative strategy suitable only if false positives are extremely costly and missing cases is acceptable.
How do precision and recall relate to false positives and false negatives?
Precision is directly related to false positives: it decreases as false positives increase. Recall is directly related to false negatives: it decreases as false negatives increase. To improve precision, reduce false positives. To improve recall, reduce false negatives. The trade-off between them is fundamental in classification.
Related methods
Sources
Fawcett, T. (2006). An introduction to ROC analysis. Pattern Recognition Letters, 27(8), 861-874.
Open DOI referencePowers, D. M. (2011). Evaluation: From Precision, Recall and F-Measure to ROC, Informedness, Markedness and Correlation. Journal of Machine Learning Technologies, 2(1), 37-63.
Open publication referenceHan, Kamber & Pei, Data Mining: Concepts and Techniques, 3rd ed. (Morgan Kaufmann, 2011), p. 368