Data & ComputingEvaluation MetricsA-Level
CambridgeAQAIBAbiturAPBaccalauréat GénéralBachilleratoCAPS

Precision

Accuracy of positive predictions.

Understand the formulaSee the free derivationOpen the full walkthrough

This public page keeps the free explanation visible and leaves premium worked solving, advanced walkthroughs, and saved study tools inside the app.

Core idea

Overview

Precision, also known as positive predictive value, quantifies the accuracy of a model's positive classifications. It represents the proportion of items identified as positive that truly belong to the positive class.

When to use: Apply this metric when the cost of a false positive is high, such as in spam detection or legal judgments. It is most effective when you need to be confident that every positive result is legitimate, even if you miss some positives.

Why it matters: Precision is vital for maintaining system credibility and avoiding unnecessary actions triggered by false alarms. In fields like facial recognition or credit card fraud, high precision prevents inconveniencing innocent users or wasting investigative resources.

Symbols

Variables

P = Precision, TP = True Positives, FP = False Positives

Precision
True Positives
False Positives

Walkthrough

Derivation

Understanding Precision

Precision is the fraction of predicted positives that are truly positive, measuring how trustworthy positive predictions are.

  • Binary classification setting.
  • Confusion matrix counts TP and FP are available.
1

Identify the needed confusion-matrix counts:

TP are correctly predicted positives; FP are predicted positives that are actually negative.

2

Compute precision:

Divide true positives by all predicted positives. High precision means few false alarms.

Note: If TP+FP=0 (no predicted positives), precision is undefined; conventions may set it to 0.

Result

Source: OCR A-Level Computer Science — Algorithms and Data

Free formulas

Rearrangements

Solve for

Make P the subject

Exact symbolic rearrangement generated deterministically for P.

Difficulty: 3/5

Solve for

Make TP the subject

Exact symbolic rearrangement generated deterministically for TP.

Difficulty: 3/5

Solve for

Make FP the subject

Exact symbolic rearrangement generated deterministically for FP.

Difficulty: 3/5

The static page shows the finished rearrangements. The app keeps the full worked algebra walkthrough.

Visual intuition

Graph

The graph of Precision (P) against an independent variable representing False Positives (FP) is a hyperbolic curve that decreases as FP increases. As FP approaches infinity, the graph approaches a horizontal asymptote at zero, while the y-intercept is fixed at one when FP is zero.

Graph type: hyperbolic

Why it behaves this way

Intuition

Imagine a collection of all items the model predicted as positive; precision is the fraction of those items that are actually positive.

TP
The number of instances that are actually positive and were correctly predicted as positive by the model.
These are the 'hits' or correct positive classifications.
FP
The number of instances that are actually negative but were incorrectly predicted as positive by the model.
These are 'false alarms' or incorrect positive classifications.
TP + FP
The total number of instances that the model predicted as positive, regardless of whether they were actually positive or negative.
This represents all items the model 'flagged' as positive.

Signs and relationships

  • denominator (TP + FP): The sum `TP + FP` represents all instances the model classified as positive. Dividing `TP` by this sum normalizes the count of correct positive predictions by the total number of positive predictions made, yielding a

Free study cues

Insight

Canonical usage

This equation calculates a dimensionless ratio representing the proportion of true positive predictions among all positive predictions, typically expressed as a decimal or percentage.

Common confusion

Students may sometimes incorrectly attempt to assign physical units to TP or FP, or forget that precision must always fall within the range of 0 to 1 (or 0% to 100%).

Dimension note

Precision is a dimensionless quantity as it is a ratio of counts (true positives and false positives). Both the numerator (TP) and the denominator (TP + FP)

Unit systems

count · Represents the number of true positive instances.
count · Represents the number of false positive instances.

One free problem

Practice Problem

A malware detection system flags 100 files as malicious. Upon review, 85 were found to be actual viruses, while 15 were safe system files. Calculate the precision of the detection system.

True Positives85
False Positives15

Solve for:

Hint: Divide the count of true positives by the total number of positive predictions.

The full worked solution stays in the interactive walkthrough.

Where it shows up

Real-World Context

Spam detection where false positives are harmful.

Study smarter

Tips

  • Balance precision against recall to understand full model performance.
  • High precision often comes at the cost of missing some actual positive cases.
  • Always verify the total number of predictions to ensure the sample size is significant.

Avoid these traps

Common Mistakes

  • Confusing precision with recall.
  • Using FN instead of FP.

Common questions

Frequently Asked Questions

Precision is the fraction of predicted positives that are truly positive, measuring how trustworthy positive predictions are.

Apply this metric when the cost of a false positive is high, such as in spam detection or legal judgments. It is most effective when you need to be confident that every positive result is legitimate, even if you miss some positives.

Precision is vital for maintaining system credibility and avoiding unnecessary actions triggered by false alarms. In fields like facial recognition or credit card fraud, high precision prevents inconveniencing innocent users or wasting investigative resources.

Confusing precision with recall. Using FN instead of FP.

Spam detection where false positives are harmful.

Balance precision against recall to understand full model performance. High precision often comes at the cost of missing some actual positive cases. Always verify the total number of predictions to ensure the sample size is significant.

References

Sources

  1. Wikipedia: Precision and recall
  2. An Introduction to Statistical Learning: with Applications in R by James, Witten, Hastie, Tibshirani
  3. Wikipedia: Confusion matrix
  4. The Elements of Statistical Learning (Hastie, Tibshirani, Friedman)
  5. Hastie, T., Tibshirani, R., & Friedman, J. (2009). The Elements of Statistical Learning: Data Mining, Inference, and Prediction (2nd ed.).
  6. Wikipedia: Precision and recall (article title)
  7. OCR A-Level Computer Science — Algorithms and Data