Coding Now – Best AI & Full Stack Courses in Delhi NCR | 100% Placement
Limited Offer: Get 50% OFF on AI & Full Stack Courses
📞 Call Now: +91 9667708830
Back to Machine Learning Notes
Topic #1709

Recall

Recall (also called sensitivity) answers: "of everything that was actually positive, how much did the model actually catch?" — the right metric when a false negative is the costly, dangerous error.

Formula

\[ \text{Recall} = \frac{TP}{TP+FN} \]

Worked Example

Using the same confusion matrix (\(TP=15, FN=5\)):

\[ \text{Recall} = \frac{15}{15+5} = \frac{15}{20} = 0.75 \]

Of the 20 actual fraud cases, the model caught 15 — 75% of all real fraud, missing the remaining 5.

from sklearn.metrics import recall_score

y_true = [1]*20 + [0]*80
y_pred = [1]*15 + [0]*5 + [1]*10 + [0]*70

print(recall_score(y_true, y_pred))   # 0.75

When Recall Is the Metric That Matters Most

High recall matters most when a false negative is dangerous or costly: missing an actual cancer diagnosis, letting real fraud through undetected, failing to flag a genuinely defective product before shipping. In all these cases, missing a true positive has severe consequences — worth tolerating more false alarms to catch nearly every real case.

Recall Can Be Trivially Maximized — A Genuine Trap

# Predicting "positive" for EVERYTHING achieves perfect recall...
y_pred_naive = [1] * 100
print(recall_score(y_true, y_pred_naive))   # 1.0 -- perfect, but useless

from sklearn.metrics import precision_score
print(precision_score(y_true, y_pred_naive))   # 0.2 -- terrible precision reveals the problem

This is exactly why recall is almost never reported alone — a model that predicts "positive" for everything achieves perfect recall while being practically worthless, which is only revealed by also checking precision.

Practical Use Cases

  • Medical screening — missing a real disease case (false negative) is typically far worse than a false alarm requiring further, harmless testing
  • Security and fraud detection — missing genuine fraud is usually costlier than investigating a false alarm

Common Mistakes

  • Reporting recall alone without precision, hiding a model that simply over-predicts the positive class to inflate this one number.
  • Confusing recall with precision — recall only considers actual positives, ignoring how many predicted positives were wrong.

Interview Relevance

Q: "Why would a cancer-screening model prioritize recall over precision?" A false negative (missing an actual cancer case) can be life-threatening, while a false positive typically only leads to additional, safer follow-up testing — the asymmetric cost of the two error types makes recall the priority, even at some expense to precision.

Practice Question

Given \(TP=90, FN=10\), compute recall by hand. Now suppose \(FN=90, TP=10\) instead — recompute and interpret the dramatic difference.

Related ML Notes

Want to go beyond the notes?

Join CodingNow's Machine Learning course — live mentorship, real projects, and 100% placement support.

Enroll Now — Free Demo Available
💬 Talk to Advisor
1
WhatsApp

Latest from Our Blog

Insights on AI, Data Science, Full Stack & Career

View All Articles →