Evaluating Ranked Results
Precision and recall treat a result set as a bag: a document is either in the set or not, and the metrics do not change if the order is shuffled. A ranked retrieval system does more than decide which documents to return; it decides which ones to show first. A user who reads from the top and stops after five items gets a very different experience depending on whether the relevant books are at ranks 1 and 2 or at ranks 16 and 18. Evaluation must account for position, not only membership.
Recall the first five positions from Designing a Retrieval Benchmark:
| Rank | System A result | Useful? | System B result | Useful? |
|---|---|---|---|---|
| 1 | Computer Organization and Design | yes | Database Systems: The Complete Book | yes |
| 2 | Operating System Concepts | yes | Pattern Recognition and Machine Learning | yes |
| 3 | The Handmaid’s Tale | no | Introduction to Algorithms | yes |
| 4 | Narrative of the Life of Frederick Douglass | no | On the Origin of Species | no |
| 5 | Towards a New Architecture | no | Introduction to the Theory of Computation | yes |
System A retrieves 25 books total (12 of 15 relevant); System B retrieves 8 (6 of 15 relevant). The set-based precision numbers from Precision and Recall already showed that B is more precise overall, but ranking adds a second dimension: how quickly does the user reach useful material? System A places two relevant books at the top, then three misses; System B delivers four of five.
Precision at Rank k¶
The simplest rank-aware metric evaluates only the first positions. Precision at rank counts how many of the top- documents are relevant, ignoring everything below.
answers one practical question: if the user reads only the first items, what proportion is useful? It does not require knowing how many relevant documents exist in the collection, which makes it easy to compute and interpret. It also does not penalize a system for missing relevant documents below rank : a system that places one relevant book at rank 1 and nothing else achieves regardless of how many relevant books it missed.
System B dominates at every cutoff. A student who reads the first five results gets four useful books from B but only two from A. captures this user experience directly.
Reciprocal Rank and MRR¶
Some information needs have a single correct answer, or the user is satisfied as soon as one relevant result appears. A library patron asking “Who wrote Dracula?” needs exactly one fact; seeing it at rank 1 is ideal, at rank 20 is frustrating. The reciprocal rank captures this notion.
when the first result is relevant; when the first relevant result is at rank 2; as the relevant document is pushed further down. If no relevant document appears in the result list at all, .
MRR is widely used in question answering and known-item search, where one good answer suffices. It ignores what happens after the first relevant document: a system that places five relevant books at ranks 1 through 5 scores the same as one that places a single relevant book at rank 1 and nothing else. For needs where multiple relevant documents matter, as in our CS-foundations example with 15 relevant books, MRR is the wrong tool.
The Precision-Recall Curve¶
evaluates one fixed cutoff. A more complete picture plots precision against recall at every rank where a relevant document appears. As the system returns more documents, recall increases (more relevant documents are found) and precision typically decreases (more non-relevant documents accumulate). Plotting precision against recall produces the precision-recall curve.
At each rank in the result list, define:
A point is recorded only at ranks where a relevant document is retrieved: those are the only ranks where recall changes. Between two relevant documents, recall stays constant while precision drops (the denominator grows with no new relevant hit), so these in-between ranks do not add new curve points.
Reading the Curve¶
Figure 1 annotates the key regions of a precision-recall curve. The upper-left corner (high precision, low recall) is where a fact-checker operates: a short, clean result list with few mistakes. The lower-right corner (high recall, low precision) is where a patent lawyer operates: an exhaustive search that tolerates noise to avoid missing anything. The diagonal arrow labelled “system efficiency” points toward the ideal corner : the closer a curve pushes toward that point, the better the system balances both goals simultaneously.

Figure 1:Precision-recall curve with key evaluation landmarks: the shaded area is Average Precision (AP), R-precision marks the point where the number of results equals the number of relevant documents, and the two user profiles illustrate the trade-off between precision-oriented and recall-oriented search.
The shaded area under the curve represents Average Precision (AP), which the next subsection defines formally. The figure marks R-precision at rank , where is the number of relevant documents. At this cutoff, precision and recall are numerically equal because both divide the number of relevant documents retrieved in the first positions by .
Interpolation for Cross-System Comparison¶
The 12 points in the table above form a smooth, largely decreasing scatter for one system and one need. The need for interpolation arises when we want to compare two systems or average curves across multiple needs: each system produces points at different recall levels, so we cannot directly subtract or average their precisions. Interpolation defines precision at any recall level as the maximum precision achieved at any recall level :
This produces a non-increasing step function evaluated at standard recall levels (0, 0.1, 0.2, ..., 1.0). Two systems evaluated on the same 11 recall points can be compared point by point or averaged across queries. For System A, interpolated precision at recall 0 is 1.0 (the best precision it ever achieves), while at recall 0.9 and 1.0 it is 0 (the system never reaches those recall levels).
R-Precision¶
R-precision links precision to recall through a single number. If the collection contains relevant documents for a need, R-precision is the precision after exactly documents have been retrieved.
A perfect system would place all relevant documents in the first positions, achieving R-precision of 1.0. The measure adjusts itself to the difficulty of the need: a need with 15 relevant documents (our CS-foundations example) evaluates at cutoff 15, while a need with 2 relevant documents evaluates at cutoff 2.
R-precision is simple and self-adjusting, but it reduces an entire ranking to one point. The metrics that follow evaluate the full curve.
Average Precision¶
Average precision (AP) collapses the precision-recall curve into a single number. Geometrically, it approximates the area under the precision-recall curve: the shaded region in Figure 1. A system whose curve stays high across all recall levels has a large area and a high AP; one whose precision collapses early has a small area and a low AP.
The computation is straightforward: at each rank where a relevant document appears, record the precision at that rank. Then take the mean of those values, using the total number of relevant documents in the collection as the divisor.
Dividing by rather than by the number of relevant documents actually found means that missed documents contribute implicit zeros: they never appear in the ranking, so they add nothing to the numerator, but the denominator still counts them. This is what makes AP sensitive to recall, not only to precision at the top.
AP uses the raw (non-interpolated) precision values. Interpolation serves a different purpose: it defines precision at arbitrary recall levels so that curves from different systems can be compared point by point or averaged. AP does not require that step because it sums only at the fixed rank positions where relevant documents actually occur.
AP rewards both placing relevant documents high (each precision term is larger when fewer non-relevant documents precede it) and finding more relevant documents (more terms contribute to the sum). This makes it the single best summary of a ranking for a given need: unlike it accounts for the full list, and unlike MRR it values every relevant document, not only the first.
Mean Average Precision¶
Evaluating a system on one need gives one AP value. A benchmark with multiple needs produces an AP per need, and mean average precision (MAP) averages them.
MAP is a macro-average: each need contributes equally regardless of how many relevant documents it contains. This is the same averaging strategy discussed in Precision and Recall, and the same caveats apply: a need with one relevant document has as much influence on MAP as a need with fifteen.
MAP is the standard primary metric in TREC and most retrieval benchmarks. A single MAP value summarizes an entire system’s behaviour across all evaluated needs. When two systems are compared, a paired test (such as a paired -test or Wilcoxon signed-rank test) on the per-need AP values determines whether the difference is statistically significant, not just the result of a few easy or hard queries.
Choosing a Metric¶
Each metric answers a different question about the ranking:
| Metric | Question it answers | Sensitive to |
|---|---|---|
| How clean are the first results? | Precision at a fixed cutoff | |
| How quickly does the user find one good result? | Position of the first relevant document | |
| How well does the system fill the first slots? | Balance of precision and recall at a natural cutoff | |
| How good is the overall ranking for one need? | Both precision and recall, position-weighted | |
| How good is the system across many needs? | Per-need AP, macro-averaged |
and MRR suit settings where users inspect only the top few results: web search, question answering, voice assistants. AP and MAP suit settings where the full ranking matters: patent search, systematic reviews, benchmark comparisons. R-precision provides a single summary that adjusts to the number of relevant documents per need.
All of these metrics treat relevance as binary: a document is relevant or it is not. The next section relaxes this assumption, introducing graded relevance where some documents are more useful than others, and metrics that reward a system for placing highly relevant documents above marginally relevant ones.