Recall-at-k is a metric used in machine learning and information retrieval to evaluate how well a system retrieves relevant items from a dataset. Specifically, it measures the proportion of truly relevant items that appear within the top k results returned by a model or algorithm. For example, if a search engine retrieves 10 results (k=10) and 5 of them are relevant out of a total of 8 relevant items in the entire dataset, the recall@10 would be 5/8 = 62.5%[7]. This metric is particularly useful in scenarios where the goal is to maximize the coverage of relevant items, such as recommendation systems or document retrieval tasks.
The key difference between recall-at-k and precision-at-k lies in their focus. While precision measures the fraction of relevant items within the top k results, recall measures how many of the total relevant items were captured in those k results. For instance, in a music recommendation system, if a user has 20 liked songs and the model recommends 15 songs (k=15) with 10 matches to the user’s preferences, the recall@15 would be 10/20 = 50%. This emphasizes whether the system avoids missing too many relevant items, even if some recommendations are less precise[7]. Developers often use recall-at-k alongside precision to balance coverage and accuracy.
A practical application of recall-at-k is in e-commerce product searches. Suppose a database contains 100 products matching a query for “wireless headphones,” and a customer views the first 20 results (k=20). If 15 of those 20 results are truly relevant, but there are 80 relevant products in total, the recall@20 is 15/80 = 18.75%. This low score indicates the system prioritizes ranking a few highly relevant items at the top but misses many others. To improve recall, developers might adjust ranking algorithms or expand the diversity of results within the top k[7]. Tools like collaborative filtering or semantic search enhancements are common strategies to address this trade-off.
[7] recall_questions
Zilliz Cloud is a managed vector database built on Milvus perfect for building GenAI applications.
Try FreeLike the article? Spread the word