Precision@k measures the proportion of relevant items among the first k recommendations or retrieved results. Use it when the quality of the top results matters most: three relevant titles in five recommendations produce P@5 = 3/5, or 60%. section 1.3.5
Apply Precision@k within an offline evaluation rather than treating it as a complete product-quality signal:
- Generate ranked recommendation lists for users in a holdout dataset. section 2.2.3
- Define relevance with an available proxy, such as a high rating, watch, click, save, or meaningful engagement action. section 2.2.3
- Count relevant items in the top k and divide by the evaluated recommendation count. section 2.2.3
- Slice results across cold-start users, sparse histories, and niche preferences to expose uneven performance. section 2.2.3
- Pair the metric with diversity, coverage, novelty, satisfaction, latency, or NDCG when repetition, concentration, position, or system constraints matter. section 1.3.5 section 2.2.3
Movie recommendations
Suppose five TV shows are recommended and three match the user's prior watch history or labeled preferences. Precision@5 is 60%. A test-set implementation can define relevance as a rating of 4 or higher, extract the user's relevant movies, compare them with the top-k recommendations, and return the hit count divided by the evaluated list length. Users without relevant test data should be excluded or handled explicitly.


