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

Milvus
Zilliz

What is Mean Average Precision (MAP) in recommender systems?

Mean Average Precision (MAP) is a metric used to evaluate the performance of recommender systems by measuring how well the system orders recommended items, prioritizing relevance. Unlike simpler metrics like precision or recall, MAP accounts for both the relevance of items and their ranking positions. It is calculated by first computing the Average Precision (AP) for each user, then taking the mean of these values across all users. This makes MAP particularly useful for scenarios where the order of recommendations matters, such as when users are more likely to engage with top-ranked items.

Average Precision (AP) focuses on the ranking quality for a single user. For example, suppose a recommender system suggests 5 movies to a user, and the user has previously liked 3 of them (ground-truth relevant items). If the relevant movies appear at positions 1, 3, and 5 in the recommendations, AP calculates the precision at each of these positions and averages them. Precision at position k is the number of relevant items in the top k recommendations divided by k. For the example:

  • At position 1: Precision = 1/1 = 1.0
  • At position 3: Two relevant items (positions 1 and 3), so precision = 2/3 ≈ 0.67
  • At position 5: All three relevant items are included, so precision = 3/5 = 0.6 AP averages these values: (1.0 + 0.67 + 0.6) / 3 ≈ 0.76. This rewards systems that place relevant items earlier in the list.

MAP extends AP to the entire user base. If User A has an AP of 0.76 and User B has an AP of 0.5, the MAP is (0.76 + 0.5)/2 = 0.63. MAP is especially valuable because it penalizes systems that bury relevant items in lower positions, even if those items are eventually included. However, MAP assumes all relevant items are equally important and does not account for varying user preferences beyond binary relevance. Developers often use MAP with a fixed cutoff (e.g., top 10 recommendations) to balance computational cost and practical relevance. By focusing on ranking quality, MAP helps optimize systems to surface the most useful items first, directly aligning with user behavior in real-world applications.

Like the article? Spread the word