🔥Limited Offer: Get 50% OFFon AI & Full Stack Courses🔥
Back to Machine Learning Notes
Topic #182

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.

Want to go beyond the notes?

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

Enroll Now — Free Demo Available

Recall – FAQs

Quick answers about learning Recall in Machine Learning.

This free note from CodingNow 2.0 explains Recall in Machine Learning — concept, syntax and worked code examples you can copy, run and revise before interviews.
Yes. Every Machine Learning topic on CodingNow 2.0, including Recall, is 100% free with no signup required.
With focused practice, most students grasp Recall in 1–3 days from these notes; pairing it with CodingNow 2.0's mentor-led course takes you to job-ready depth faster.
Use the code examples in this note, then ask doubts for free on the CodingNow 2.0 Community (/community) — expert instructors answer within 24 hours.
WhatsApp
Call NowEnroll Now