# Mean average precision (mAP)

> Canonical: https://skillalmanac.com/glossary/mean-average-precision | Last verified: 2026-11-24 | Index status: index-eligible

Average precision summarizes ranked precision and recall under a stated evaluation convention. Mean average precision averages AP over queries or classes, sometimes with additional benchmark settings. Report the task and protocol: similarly named scores can use different conventions.

Also called: map metric, map object detection.

## In plain language

Imagine a search engine returns ten results and you check which are actually useful. Average precision rewards putting the useful ones near the top: finding a good result at position one counts for more than finding it at position nine. Doing that for many different searches and averaging the results gives mean average precision. In image tasks, the same idea is used to score a model that draws boxes around objects. It gives one number, which is convenient, but it hides detail: two systems with the same score can fail in different ways, and the number depends on how 'correct' was defined.

## Technical definition

In information retrieval, average precision for one query walks down the ranked list and sums the precision at each rank where a relevant document appears, divided by the number of relevant documents. Mean average precision is the mean of that value over a set of queries. scikit-learn defines average precision for classifiers as the weighted mean of precisions at each threshold, weighted by the increase in recall, and notes this is not the trapezoidal area under the precision-recall curve. In object detection, Ultralytics describes mAP as AP averaged across classes, with mAP50 using an IoU threshold of 0.50 and mAP50-95 averaging over thresholds from 0.50 to 0.95. Definitions vary between benchmarks.

## How it shows up when you use agents

mAP can appear when an agent helps evaluate retrieval or object detection. In retrieval work, an agent or a team compares search setups on a set of test queries with known relevant documents, and mAP is one score for that. In computer-vision work, model cards and tools report mAP for an [object detection](/glossary/object-detection) model, often with the thresholds written as mAP50 or mAP50-95.

What breaks when it is misunderstood: people compare mAP numbers from different benchmarks as if they were the same quantity. Definitions vary, such as which [IoU threshold](/glossary/intersection-over-union) counts a box as correct and whether the curve is interpolated. A single score also hides whether the system misses items or ranks them low. The name is also confusing, because "AP" means average precision here and not "accuracy".

A next action: when an agent reports mAP, ask which task it is (ranking or detection), which thresholds were used and on what test set. Look at [precision and recall](/glossary/precision-and-recall) alongside it. For retrieval, build a small labelled test set first, as the [llm-eval-test-sets skill](/skills/skill-almanac/llm-eval-test-sets) helps you do, and inspect real failures after the score. Ranking tweaks such as [reranking](/glossary/reranking) are tested with metrics of this kind.

## Worked example (illustrative)

For one two-item ranking, actual relevance [0,1] with scores [0.9,0.8] gives average precision 0.5 in scikit-learn, while trapezoidal precision-recall area is 0.25. If a second query has AP 1, their unweighted mean AP is 0.75. These computed examples use specified binary relevance and no tied scores; they do not define every object-detection benchmark convention.

## Common confusions

- **Average precision versus mean average precision.** Average precision scores one query or one class. Mean average precision averages those scores across queries or classes.
- **mAP versus accuracy.** mAP depends on the order of ranked results or on confidence scores.
- **mAP50 versus mAP50-95.** The first uses a single IoU threshold of 0.50. The second averages over thresholds from 0.50 to 0.95, as Ultralytics describes.
- **Myth.** A higher mAP means better results for your use. It is a score on one test set under one definition, and your data may differ.

## Worked examples in this catalogue

### [llm-eval-test-sets](https://skillalmanac.com/skills/skill-almanac/llm-eval-test-sets)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: An eval dataset for an LLM feature, with a checker for duplicates, missing graders, imbalance and leakage.

Why it exercises the concept: A ranking score like mAP needs a test set with known relevant items. The skill builds and checks that kind of test set, though it does not compute mAP itself.

### [rag-chunking-planner](https://skillalmanac.com/skills/skill-almanac/rag-chunking-planner)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: Your documents chunked by three strategies, with defects and offline recall reported for each, so chunk settings are chosen with numbers.

Why it exercises the concept: It measures retrieval offline with recall. mAP is a related offline measure that also rewards placing correct items high in the list.

### [What Is RAG? Retrieval-Augmented Generation Explained](https://skillalmanac.com/learn/what-is-rag)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: The guide describes indexing documents and querying them, and advises logging the top retrieved chunks for each failing question.

Why it exercises the concept: Logging the top retrieved chunks gives you the ranked lists that a ranking score like mAP would be computed on.

## Related terms

- [Precision and recall](https://skillalmanac.com/glossary/precision-and-recall.md)
- [Object detection](https://skillalmanac.com/glossary/object-detection.md)
- [Intersection over union (IoU)](https://skillalmanac.com/glossary/intersection-over-union.md)
- [Reranking](https://skillalmanac.com/glossary/reranking.md)
- [Semantic search](https://skillalmanac.com/glossary/semantic-search.md)
- [LLM benchmark](https://skillalmanac.com/glossary/llm-benchmark.md)

## Sources

- [Evaluation measures (information retrieval)](https://en.wikipedia.org/wiki/Evaluation_measures_(information_retrieval)), Wikipedia (accessed 2026-11-24)
- [average_precision_score](https://scikit-learn.org/stable/modules/generated/sklearn.metrics.average_precision_score.html), scikit-learn (accessed 2026-11-24)
- [Performance metrics deep dive](https://docs.ultralytics.com/guides/yolo-performance-metrics/), Ultralytics (accessed 2026-11-24)

Definitions are written by Skill Almanac from the sources above and checked against them on 2026-11-24. [Glossary index](https://skillalmanac.com/glossary.md).
