100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace
AI Fundamentals

Precision and Recall

BeginnerConcept9.1K learners

Precision and recall are two complementary metrics for evaluating a classification model: precision measures how many of the model's positive predictions were actually correct, while recall measures how many of the actual positive cases…

Definition

Precision and recall are two complementary metrics for evaluating a classification model: precision measures how many of the model's positive predictions were actually correct, while recall measures how many of the actual positive cases the model successfully found.

Overview

Precision and recall are both derived from the same underlying counts found in a confusion matrix, but they answer different questions. Precision is calculated as true positives divided by (true positives + false positives) — of everything the model flagged as positive, what fraction was actually correct? Recall is calculated as true positives divided by (true positives + false negatives) — of everything that was actually positive, what fraction did the model successfully catch? The two metrics are usually in tension: a model can achieve near-perfect recall by predicting 'positive' for almost everything, catching nearly all true positives but generating many false positives and tanking precision. Conversely, a model can achieve high precision by only predicting positive when it's very confident, missing many true positives and tanking recall. Which metric matters more depends entirely on the cost of each type of error: a spam filter typically favors precision (you don't want to lose real emails to the spam folder), while a cancer-screening test typically favors recall (missing a real case is far worse than a false alarm that triggers a follow-up test). Because of this tradeoff, precision and recall are rarely reported alone — they're usually reported together, sometimes summarized into a single balanced metric, the F1 score, or visualized across different decision thresholds using a ROC curve or precision-recall curve. These metrics are foundational to evaluating any classification model and are covered early in most applied machine learning curricula, including Machine Learning Fundamentals.

Key Concepts

  • Precision measures the correctness of positive predictions: true positives over all predicted positives
  • Recall measures completeness of detection: true positives over all actual positives
  • The two metrics typically trade off against each other as a decision threshold changes
  • Which metric to prioritize depends on the relative cost of false positives versus false negatives
  • Both are derived directly from confusion matrix counts
  • Commonly summarized together via the F1 score or visualized via a precision-recall curve

Use Cases

Tuning a spam filter to favor precision and avoid losing legitimate emails
Tuning a medical screening model to favor recall and avoid missing real cases
Evaluating fraud-detection systems where both false positives and false negatives carry cost
Choosing a classification decision threshold based on business error tolerance
Comparing candidate models beyond a single accuracy figure
Reporting classifier performance in regulated domains that require specific error guarantees

Frequently Asked Questions