Precision@K and Recall@K
What you'll learn: How to measure whether your recommender system actually puts the best items at the top of its ranked lists.
Why Top-K Metrics Matter
When a recommender system suggests 10 movies or 20 products, users rarely scroll through everything—they focus on the top few. Traditional accuracy metrics don't capture this reality. Precision@K and Recall@K measure how well your system performs specifically on the top K recommendations, which is what actually matters in production.
Understanding Precision@K
Precision@K answers: "Of the K items I recommended, how many were actually relevant?"
Precision@K = (Relevant items in top K) / K
If you recommend 10 movies and the user likes 7 of them, your Precision@10 = 7/10 = 0.70.
Think of it like precision fishing: you cast K nets and want to know what fraction caught fish.
Understanding Recall@K
Recall@K answers: "Of all the relevant items that exist, how many did I capture in my top K?"
Recall@K = (Relevant items in top K) / (Total relevant items)
If there are 20 movies the user would love, but your top-10 list includes only 7 of them, your Recall@10 = 7/20 = 0.35.
This measures completeness—did you "recall" enough of what matters?
The Trade-off
Larger K typically increases recall (more chances to catch relevant items) but may decrease precision (dilution with less-relevant picks). Choosing K depends on your application: search results might use K=5, while exploration feeds might use K=50.
Key Takeaway: Precision@K measures relevance density in your top-K recommendations, while Recall@K measures what fraction of all relevant items you successfully surfaced—both are essential for evaluating ranking quality in real-world recommender systems.