Recall (Sensitivity) of a Model

In machine learning, recall, also known as sensitivity, is a performance metric that measures a model’s ability to identify all relevant instances (true positives) within a dataset. Recall answers the question: “Of all the actual positive cases, how many did the model correctly identify?”


Definition for Recall (Sensitivity) of a Model

Recall is defined as the ratio of true positive predictions (TP) to the sum of true positives and false negatives (FN). Mathematically, it is expressed as:

Recall Formula:

\( \text{Recall} = \dfrac{\text{TP}}{\text{TP} + \text{FN}} \)

  • TP: True Positives (correctly predicted positive cases)
  • FN: False Negatives (actual positive cases the model missed)

Importance of Recall

Recall is crucial in scenarios where identifying all positive cases is more important than avoiding false positives. For example, in medical diagnostics, missing a disease (false negative) can have serious consequences, making high recall vital.


Components in a Confusion Matrix

The confusion matrix helps visualize the distribution of predictions:

Predicted: PositivePredicted: Negative
Actual: PositiveTrue Positive (TP)False Negative (FN)
Actual: NegativeFalse Positive (FP)True Negative (TN)
Components in a Confusion Matrix

Recall uses the values from the first row:

\( \text{Recall} = \dfrac{\text{TP}}{\text{TP} + \text{FN}} \)


Detailed Examples with Steps to Calculate Recall

Below are ten real-world examples that explain recall calculation step-by-step:


Example 1 – Recall (Sensitivity) of a Cancer Detection Model

Scenario: A model predicts whether a patient has cancer.

  • True positives (TP): 90
  • False negatives (FN): 10

Steps:

  1. Calculate total actual positives: TP + FN = 90 + 10 = 100.
  2. Calculate recall: Recall = TP / (TP + FN) = 90 / 100 = 0.9 (90%).

Example 2 – Recall (Sensitivity) of a Fraud Detection Model

Scenario: A model predicts whether a transaction is fraudulent.

  • TP: 70
  • FN: 30

Steps:

  1. Total actual positives: TP + FN = 70 + 30 = 100.
  2. Recall: Recall = 70 / 100 = 0.7 (70%).

Example 3 – Recall (Sensitivity) of a Spam Email Detection Model

Scenario: A model predicts whether an email is spam.

  • TP: 50
  • FN: 20

Steps:

  1. Total actual positives: TP + FN = 50 + 20 = 70.
  2. Recall: Recall = 50 / 70 = 0.7143 (71.43%).

Example 4 – Recall (Sensitivity) of a Loan Default Prediction Model

Scenario: A model predicts whether a customer will default on a loan.

  • TP: 100
  • FN: 25

Steps:

  1. Total actual positives: TP + FN = 100 + 25 = 125.
  2. Recall: Recall = 100 / 125 = 0.8 (80%).

Example 5 – Recall (Sensitivity) of a Defect Detection Model

Scenario: A model predicts whether a product is defective.

  • TP: 120
  • FN: 30

Steps:

  1. Total actual positives: TP + FN = 120 + 30 = 150.
  2. Recall: Recall = 120 / 150 = 0.8 (80%).

Example 6 – Recall (Sensitivity) of a Object Detection Model

Scenario: A model predicts whether an object in an image is a car.

  • TP: 200
  • FN: 50

Steps:

  1. Total actual positives: TP + FN = 200 + 50 = 250.
  2. Recall: Recall = 200 / 250 = 0.8 (80%).

Example 7 – Recall (Sensitivity) of a Medical Diagnostics Model

Scenario: A model predicts whether a patient has a specific disease.

  • TP: 80
  • FN: 40

Steps:

  1. Total actual positives: TP + FN = 80 + 40 = 120.
  2. Recall: Recall = 80 / 120 = 0.6667 (66.67%).

Example 8 – Recall (Sensitivity) of a Sentiment Analysis Model

Scenario: A model predicts whether a text contains positive sentiment.

  • TP: 90
  • FN: 10

Steps:

  1. Total actual positives: TP + FN = 90 + 10 = 100.
  2. Recall: Recall = 90 / 100 = 0.9 (90%).

Example 9 – Recall (Sensitivity) of a Recommendation Systems

Scenario: A model recommends items to users.

  • TP: 70
  • FN: 30

Steps:

  1. Total actual positives: TP + FN = 70 + 30 = 100.
  2. Recall: Recall = 70 / 100 = 0.7 (70%).

Example 10 – Recall (Sensitivity) of a Spam Classification Model

Scenario: A model classifies emails as spam or not spam.

  • TP: 110
  • FN: 20

Steps:

  1. Total actual positives: TP + FN = 110 + 20 = 130.
  2. Recall: Recall = 110 / 130 = 0.8462 (84.62%).

Conclusion

Recall (sensitivity) is an essential metric for evaluating machine learning models, especially in domains where identifying all positive cases is critical. However, recall should be balanced with precision using metrics like the F1 score for a holistic evaluation of model performance.