Getting Started

What is Recall in Machine Learning?

What is Recall in Machine Learning?

Recall, also known as sensitivity or true positive rate, is a metric that measures how effectively a model identifies the relevant cases in a dataset. For example, in a model designed to detect spam emails, recall would tell us the proportion of actual spam emails that the model successfully identified as spam.

Think of recall as the metric that focuses on capturing all relevant positive instances in the data, ignoring whether the model accidentally identifies non-relevant instances as positive.

The formula for recall is:

$$ \text{Recall} = \frac{\text{True Positives}}{\text{True Positives} + \text{False Negatives}} $$

where:

  • True Positives (TP): The model correctly identifies a relevant instance.
  • False Negatives (FN): The model fails to identify a relevant instance, missing a true positive.

Practical Example: Ecommerce

Imagine you have an e-commerce recommendation model that suggests "Smartphones" to users who are interested in buying a phone. You want the model to recommend all relevant smartphone products but avoid suggesting items that aren’t smartphones.

You test the model on a dataset with 100 items, where 50 items are actually smartphones and the other 50 items are other types of electronics (laptops, tablets, etc.).

The model's performance is such that:

  • True Positives (TP): 40 (The model correctly identified 40 smartphones as relevant for recommendation.)
  • False Negatives (FN): 10 (The model failed to identify 10 smartphones, missing these items in the recommendation.)

To calculate recall, we use the formula defined above:

$$ \text{Recall} = \frac{40}{40 + 10} = \frac{40}{50} = 0.8 $$

So, the recall for this recommendation model is 0.8 or 80%.

Precision vs. Recall: Understanding the Trade-Off

Recall is often discussed alongside precision, another important metric that measures the accuracy of the positive predictions. While recall focuses on capturing all relevant instances, precision aims to ensure that all captured instances are indeed relevant. This creates a trade-off: boosting recall might lower precision, as the model may capture more non-relevant cases.

This trade-off is commonly represented in classification problems where you might prioritize recall over precision or vice versa, depending on the goals. The F1 score is a metric that combines precision and recall, providing a balance for situations where both metrics are important.

Conclusion

Recall is a vital metric that helps you evaluate how well your model is identifying all relevant instances, particularly when missing instances would have a negative impact. Understanding recall can help you fine-tune your model’s performance to suit your project’s needs.

Ellie Sleightholm
Head of Developer Relations at Marqo