Table of Contents

    Recall

    MACHINE LEARNING

    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.

    In simple words — Recall tells us how many of the actual positives the model successfully detected.

    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.
    Use Recall when missing a true positive can have major consequences.

    Mathematical Formula

    RECALL FORMULA
    $$ Recall = \frac{TP}{TP + FN} $$

    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)
    CALCULATION
    $$ Recall = \frac{85}{85 + 15} = 0.85 = 85\% $$
    Insight The model correctly detected 85% of actual cancer cases — a very important metric in healthcare.

    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

    Prerequisites: Python 3.x, scikit-learn.
    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}%")
    Output The Recall value indicates how many actual positives the model correctly detected.

    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))
    Insight Higher Recall means the model is great at finding all positive cases — essential in medical models.

    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
    FocusActual positivesAll predictions
    Best ForImbalanced dataBalanced data
    ReducesFalse NegativesTotal errors
    Use CaseCancer, fraud, securityGeneral classification

    Recall vs Precision

    Aspect Recall Precision
    FocusHow many real positives detectedHow many predicted positives correct
    ReducesFalse NegativesFalse Positives
    Used WhenFNs are dangerousFPs are dangerous
    ExampleCancer detectionSpam detection
    Tip: Precision and Recall often have a trade-off. Use F1-Score to balance them.

    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

    Limitation 1 Doesn't consider False Positives.
    Limitation 2 May increase incorrect alerts.
    Limitation 3 Cannot be used alone — always combine with Precision.
    Limitation 4 Higher recall may come at the cost of accuracy.

    Common Mistakes to Avoid

    Mistake 1 Optimizing Recall alone — leads to too many False Positives.
    Mistake 2 Ignoring confusion matrix when interpreting recall.
    Mistake 3 Using Recall on balanced data where Accuracy is enough.
    Mistake 4 Misunderstanding Recall as overall correctness.

    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

    REMEMBER
    Actual Positives Detected ÷ Total Actual Positives = Recall

    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.