Recall
Recall
Measuring how well your Machine Learning model captures all the actual positives.
What is Recall?
Recall (also called Sensitivity or True Positive Rate) is a classification evaluation metric that measures the model's ability to correctly identify all actual positive cases.
Why is Recall Important?
- Measures how well the model finds all true positives.
- Critical when missing a positive case is costly.
- Used in medical, fraud, and safety-related domains.
- Helps detect serious problems like diseases or fraud.
- Works with Precision and F1-Score to evaluate model quality.
Mathematical Formula
Where:
- TP = True Positives (correctly predicted positives)
- FN = False Negatives (positives missed by the model)
Visual Intuition Using Confusion Matrix
| Predicted Positive | Predicted Negative | |
|---|---|---|
| Actual Positive | TP | FN |
| Actual Negative | FP | TN |
Recall focuses on the "Actual Positive" row — checking how many of them the model successfully detected.
Simple Example
Suppose a cancer detection model is tested on 100 patients with cancer:
- Model correctly detects 85 patients (TP)
- Model misses 15 patients (FN)
When Should You Use Recall?
Use Recall when False Negatives are dangerous or costly.
Medical Diagnosis
- Don't miss real diseases
- Save lives
Fraud Detection
- Catch every suspicious transaction
- Reduce financial loss
Cybersecurity
- Detect every attack attempt
- Avoid security breaches
Information Retrieval
- Find all relevant documents
- Avoid missing useful results
Customer Feedback
- Detect every negative review
- Improve service quality
Anomaly Detection
- Catch every unusual event
- Prevent failures
Real-Life Analogy
Recall = Fishing Net
Imagine a fisherman with a wide net. If he catches 80 out of 100 fish in the lake, his recall is 80%. Recall measures how many "real positives" the model catches — even if it pulls in a few wrong ones along the way.
High vs Low Recall
High Recall
- Model catches most positives
- Few cases are missed
- Best for life-critical apps
Low Recall
- Misses many real positives
- Dangerous in healthcare/fraud
- Indicates poor sensitivity
Python Example — Calculating Recall
pip install scikit-learn
from sklearn.metrics import recall_score
y_true = [1, 0, 1, 1, 0, 1, 0, 0, 1, 1]
y_pred = [1, 0, 0, 0, 0, 1, 0, 0, 1, 1]
recall = recall_score(y_true, y_pred)
print(f"Recall: {recall * 100:.2f}%")
Full Example — Using ML Model
from sklearn.datasets import load_breast_cancer
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import recall_score, classification_report
# Step 1: Load dataset
data = load_breast_cancer()
X, y = data.data, data.target
# Step 2: Split data
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
# Step 3: Train model
model = RandomForestClassifier()
model.fit(X_train, y_train)
# Step 4: Predict
y_pred = model.predict(X_test)
# Step 5: Evaluate
print("Recall:", recall_score(y_test, y_pred))
print("\nClassification Report:\n", classification_report(y_test, y_pred))
Recall in Multi-Class Classification
For multi-class problems:
- Macro Recall — average recall of each class (equal weight).
- Weighted Recall — average recall weighted by class frequency.
- Micro Recall — global recall across all classes.
recall_score(y_test, y_pred, average="macro")
recall_score(y_test, y_pred, average="weighted")
recall_score(y_test, y_pred, average="micro")
Recall vs Accuracy
| Aspect | Recall | Accuracy |
|---|---|---|
| Focus | Actual positives | All predictions |
| Best For | Imbalanced data | Balanced data |
| Reduces | False Negatives | Total errors |
| Use Case | Cancer, fraud, security | General classification |
Recall vs Precision
| Aspect | Recall | Precision |
|---|---|---|
| Focus | How many real positives detected | How many predicted positives correct |
| Reduces | False Negatives | False Positives |
| Used When | FNs are dangerous | FPs are dangerous |
| Example | Cancer detection | Spam detection |
Real-World Applications
Disease Screening
- Detect all real cases
- Save lives
Fraud Detection
- Catch all suspicious activity
- Prevent financial loss
Threat Detection
- Identify all security risks
- Reduce missed attacks
Search Systems
- Find all relevant documents
- Improve research
Anomaly Detection
- Catch all unusual events
- Prevent failures
Customer Support
- Identify unhappy customers
- Improve retention
Advantages of Recall
- Ensures fewer real positives are missed.
- Critical in safety-related applications.
- Best metric for imbalanced datasets.
- Reveals model's ability to handle rare events.
- Important for ethical and high-risk decisions.
Disadvantages
Common Mistakes to Avoid
Best Practices
Quick Tips
- Pair Recall with Precision and F1-Score.
- Always check confusion matrix.
- Use Recall in life-critical applications.
- Tune model threshold to improve recall.
- Use precision-recall curve for analysis.
- Interpret in business or domain context.
Importance of Recall
Life-Saving Metric
- Detects all real positives
- Vital in healthcare
Reduces Critical Errors
- Avoids missing fraud
- Improves security
Foundation Metric
- Key part of F1-Score
- Used widely with Precision
Decision Confidence
- Builds trust in predictions
- Supports safe automation
Golden Rule
Key Takeaway
Recall is a powerful Machine Learning metric that focuses on the model's ability to catch every actual positive. It's especially critical in healthcare, fraud detection, and cybersecurity, where missing a true positive could lead to serious consequences. Combine Recall with Precision and F1-Score for a complete view of your model's performance.