🚀 Try Zilliz Cloud, the fully managed Milvus, for free—experience 10x faster performance! Try Now>>

Milvus
Zilliz

What is Mean Average Precision (MAP)?

What is Mean Average Precision (MAP)? Mean Average Precision (MAP) is a metric used to evaluate the performance of information retrieval systems, such as search engines or recommendation algorithms. It measures how well a system ranks relevant items (e.g., documents, products) by averaging precision scores across multiple queries. Unlike simple precision, which calculates the fraction of relevant items in a single result set, MAP accounts for the order of results and their relevance across all queries. This makes it particularly useful for tasks where ranking quality matters, such as search or recommendation systems.

Example of MAP Calculation To compute MAP, first calculate Average Precision (AP) for each query. AP averages precision scores at every position where a relevant item appears in the ranked list. For example, suppose a search query returns five items, and relevant items are at positions 1, 3, and 5. Precision at each relevant position is 1/1 (100%), 2/3 (~66.7%), and 3/5 (60%). AP for this query is (1 + 0.667 + 0.6) / 3 ≈ 0.756. If a second query has relevant items at positions 2 and 4, with precisions 1/2 (50%) and 2/4 (50%), its AP is (0.5 + 0.5) / 2 = 0.5. MAP is the mean of these two AP scores: (0.756 + 0.5) / 2 ≈ 0.628. This reflects the system’s overall ability to rank relevant items higher across different queries.

When and Why to Use MAP MAP is commonly used to compare ranking algorithms in tasks like document retrieval, product recommendations, or image search. For instance, if two search algorithms return the same number of relevant documents, MAP helps determine which algorithm places them higher in the list. It’s favored over metrics like precision@k because it captures ranking quality across the entire result set, not just a fixed cutoff. However, MAP assumes binary relevance (items are either relevant or not), which may not suit scenarios with graded relevance (e.g., “partially relevant” items). Despite this limitation, MAP remains a standard benchmark in research and industry for evaluating ranked retrieval systems.

Like the article? Spread the word