Course contentsShow
← Machine Learning and Deep Learning
Lesson 453 of 3,53811. Model Evaluation MetricsFree lesson

Precision: Measuring Positive Prediction Quality

Calculating precision to quantify how many predicted positives are actually correct.

Precision: Measuring Positive Prediction Quality

What you'll learn: How to calculate precision to understand what fraction of your model's positive predictions are actually correct.

The Core Idea

While accuracy tells you overall correctness, precision zooms in on one specific question: When my model predicts the positive class, how often is it right?

Precision focuses exclusively on the quality of positive predictions. It ignores how many positive cases you missed—it only cares about avoiding false alarms.

Understanding Precision with an Analogy

Imagine a metal detector at an airport that beeps (predicts "threat") for suspicious items:

  • High precision = When it beeps, there's almost always a real threat
  • Low precision = It beeps constantly, mostly false alarms

You'd want high precision to avoid wasting security officers' time checking innocent passengers.

The Formula

From the confusion matrix you learned earlier:

Precision = True Positives / (True Positives + False Positives)

Or simply: correct positive predictions / all positive predictions

When Precision Matters Most

Precision is critical when false positives are costly:

  • Spam detection: Marking legitimate emails as spam frustrates users
  • Medical screening: Telling healthy patients they're sick causes unnecessary stress and expensive follow-up tests
  • Product recommendations: Suggesting irrelevant items wastes user attention

If predicting positive incorrectly has serious consequences, you want high precision.

The Trade-off to Remember

A model can achieve perfect precision by being extremely conservative—only predicting positive when absolutely certain. But it might miss many true positives in the process (we'll explore this next with recall).

Key Takeaway: Precision measures the accuracy of your positive predictions—use it when the cost of false alarms is high.