Recall measures the fraction of relevant items a system successfully retrieves. It is useful when missing relevant options matters: a high score means fewer relevant items were omitted. In offline evaluation, relevance can be defined using historical behavior, held-out labels, or another task-specific definition. section 1.3 section 3.1.2
Calculate recall by dividing the number of relevant items retrieved by the total number of relevant items. Recall@K applies the same idea to the top K results. Unlike Precision@K, which asks how many retrieved items are relevant, recall asks how many relevant items were retrieved; recall alone does not establish that the results contain few irrelevant items. section 1.3.5 section 3.1.2
Recovering a watch history
A streaming app’s “Your Recent Shows” row should retrieve a user’s previously watched TV shows without omissions. Recall is a useful offline metric for this exact-history task; low recall is a reason to investigate the retrieval algorithm for bugs. section 1.3
Figure 1.4 Differing offline metrics for each recommendation scenario. The Dramatic Yet Light Movies recommendation model uses Precision at K (P@K) to ensure that the top movies in the list are highly relevant movies for the user. The Your Recent Shows model relies on recall as the metric to optimize in an offline setting, as it focuses on ensuring the system retrieves all relevant past TV shows to give customers a complete and personalized experience.
Compare recall for a watch-history row with Precision@K for a ranked recommendation row. section 1.3
For movie recommendations, calculate recall per user by intersecting recommended movies with movies the user would watch, then dividing by the number the user would watch. The example implementation assigns zero when that denominator is empty. An average can summarize performance, but inspect results by meaningful slices too: acceptable overall recall can hide much lower recall for users who prefer foreign-language films. section 3.1.2 section 3.1.2
Listing 3.2 Computing the Offline Evaluation Recall Metric
# 7.2 Calculate recall for each user
# Recall = (number of recommended movies user would watch) / (total number of movies user would watch)
user_recall = []
for user_id, preferred_movies in user_preferences.items():
# Get recommendations for this user
recommended_movies = recommendations_df[recommendations_df['user_id'] == user_id]['movie_id'].tolist()
# Calculate intersection (recommended AND would watch)
relevant_recommendations = set(recommended_movies).intersection(set(preferred_movies))
# Calculate recall
recall = len(relevant_recommendations) / len(preferred_movies) if preferred_movies else 0
# Get user demographics
user_info = users_df[users_df['user_id'] == user_id].iloc[0]
user_recall.append({
'user_id': user_id,
'age_group': user_info['age_group'],
'subscription_type': user_info['subscription_type'],
'recall': recall
})
# Convert to DataFrame
recall_df = pd.DataFrame(user_recall)
# Display overall recall
overall_recall = recall_df['recall'].mean()
print(f"Overall Recall: {overall_recall:.4f}")
recall_df.head()
Inspect the per-user recall calculation and its handling of an empty preference list. section 3.1.2
Choose recall in light of the product goal and available data, not as a complete measure of recommendation quality. A ranked homepage may also need measures of precision, ranking, diversity, or coverage; strong performance on one offline metric can still leave users with a stale experience. section 1.3.5


































