The useful part, up front

What you’ll take away

  • Precision asks how many returned items are relevant; recall asks how many relevant items were found.
  • The cutoff, relevance policy, retrieved unit and judgment coverage belong beside every score.
  • Equal precision and recall can hide different rankings; reciprocal rank and nDCG notice different aspects of order.
  • Unjudged is a missing label, and a score against known judgments does not prove complete knowledge of the corpus.
  • Separate tuning from final assessment and evaluate generated answers and operational requirements independently.
01

Name the result you are evaluating

A search result can look sensible without containing the material someone needs. Evaluating retrieval means comparing the returned items with a stated information need and a set of relevance judgments. Elastic's ranking-evaluation guide identifies three ingredients: a document collection, typical search requests and ratings for those requests. TREC likewise builds evaluations around defined tasks, corpora, queries and judgments [1][2]. A score becomes interpretable only when those ingredients are visible. The same number can mean different things on two different collections.

Start with a sentence such as: this test checks whether the first five retrieved documents include the instructions needed for this question. That sentence defines a boundary. It does not say whether a generated answer explains the instructions accurately, whether a page loads quickly or whether a user completes the task. Those may all deserve their own checks. This guide follows one completely invented collection, with every relevant item declared in advance, so the arithmetic is easy to audit. The purpose is to understand what the measures count before trusting a dashboard that presents them as evidence of overall quality.

The evaluated list and the later answer are different outputs. Conceptual scope, not a measured pipeline. Separate questions require evidence about the corresponding output.
Conceptual scope, not a measured pipeline. Separate questions require evidence about the corresponding output. · Ameer Journal — original explanatory diagramOriginal editorial illustration; no third-party artwork reused.
02

Write the information need before assigning labels

Our fictional drawing app has eight help documents, called A through H. The request is: find instructions for exporting a project as SVG through any supported interface. A covers desktop export, C covers web export, F covers batch export and H covers command-line export. Those four are relevant by our stated rule. B explains importing SVG; D changes the colour theme; E lists shortcuts; G manages fonts. Those four are not relevant to this request. These document descriptions and labels are invented for the exercise.

Notice how a change in the request could change a label. Someone asking specifically for desktop steps might not accept a command-line procedure. Elastic says judgments must be made for each query according to the user's information need [2]. Decide that need before looking at the system's preferred results. Also state whether you rate whole documents or individual passages. The historical TREC English-judgment guidance treats a document as relevant when any useful part addresses its topic; TREC's broader current guidance says judgment scales and coverage vary by task [1][4]. A label policy belongs to its evaluation, not to every possible search.

03

Precision and recall use different denominators

Suppose the invented search returns A, B, C, D and E as its first five results. Two of those five, A and C, are relevant. Precision at five is therefore 2/5, or 40%: how much of this five-result list is useful under our labels? Recall at five is 2/4, or 50%: how much of the collection's four relevant documents did the list find? These are the precision and recall definitions applied to our fixture [2]. Neither percentage is the probability that a generated answer will be correct.

Now look only at the first three results, A, B and C. Precision at three is 2/3, about 66.7%, while recall remains 2/4, or 50%. Adding D and E made the list longer without finding another relevant item. Precision fell; recall did not rise. That is why a cutoff belongs beside the metric name. A system showing P@3 and another showing P@5 have not necessarily been compared on the same task. Decide how many results a person or later component will actually receive, then evaluate that boundary.

One invented result list, two denominators. Fully judged toy corpus: A,C,F,H are relevant among eight documents. Returned top five: A,B,C,D,E. Only A and C are relevant.
Fully judged toy corpus: A,C,F,H are relevant among eight documents. Returned top five: A,B,C,D,E. Only A and C are relevant. · Ameer Journal — original explanatory diagramOriginal editorial illustration; no third-party artwork reused.
04

The same retrieved set can put the useful item much later

Reorder the same five documents as B, D, A, E and C. Precision at five remains 40% and recall at five remains 50%, because A and C are still the two relevant items. Yet a reader now passes two unsuitable results before reaching the first useful one. Elastic notes that precision and recall at a cutoff do not distinguish positions within that cutoff [2]. A list can therefore keep both scores unchanged while making its first useful result harder to reach.

Reciprocal rank asks a narrower question: where is the first relevant result? The original order has its first relevant item at position one, giving 1/1 = 1. The reordered list reaches it at position three, giving 1/3, about 0.333. Mean reciprocal rank averages such query-level values across an evaluation set [2]. It emphasizes the first success and does not reward finding additional relevant items after that success. If the task is to gather several different instructions, keep a coverage measure as well. Choosing a metric means choosing which differences the evaluation will notice.

05

Discounted gain can distinguish the rest of the ranking

A ranking measure can also reward useful items throughout a list while giving earlier positions more weight. Scikit-learn describes normalized discounted cumulative gain, or nDCG, as discounted relevance divided by the best possible discounted result [3]. The definition of relevance and the discount rule still matter. We will use a simple binary example: useful items get one, others zero, and the weight at position r is one divided by log base two of r plus one. These are declared calculation rules, not a measured user-attention pattern.

For A, B, C, D, E, the relevant positions are one and three, contributing 1 and 0.5, for a total of 1.5. The ideal top five places our four relevant documents first, with weights about 1, 0.631, 0.5 and 0.431, totaling 2.5616. The normalized result is about 0.586. For B, D, A, E, C, useful items at positions three and five contribute about 0.887, giving about 0.346 after the same normalization. The equal precision and recall scores now lead to different ranking scores, because the order affects the declared discount.

06

An unjudged document is a missing label

Our eight-document example is unusually tidy because every label is known. Real evaluations may judge only part of a much larger collection. TREC's historical English-judgment guidance explains pooling: selected results are gathered for assessment, with completeness relying on an assumption that most relevant documents have been found. It also warns that the document collection and judgment files must match [4]. That is different from proving that every document outside the judged set is useless.

Suppose a real result lacks a relevance label. Record it as unjudged before deciding how the chosen metric will handle it. If it is genuinely relevant, silently treating it as a known negative can change the conclusion about the run. Equally, labeling every unknown result as relevant would be unjustified. The practical response is to inspect judgment coverage and keep the scoring policy visible. TREC says coverage and rating scales vary across tasks [1]. A recall figure calculated against known relevant items describes those judgments; it cannot by itself prove that all relevant material in an evolving collection has been found.

Keep unknown judgments distinguishable. TREC judgment coverage and scales vary by task. A scoring convention for unknowns is separate from knowing whether an item is useful.
TREC judgment coverage and scales vary by task. A scoring convention for unknowns is separate from knowing whether an item is useful. · Ameer Journal — original explanatory diagramOriginal editorial illustration; no third-party artwork reused.
07

Averaging can hide whose questions improved

A test suite contains different questions, and they may not have equal numbers of relevant documents. Consider a separate invented two-query example. For query one, a system finds two of four relevant items, giving recall of 50%. For query two, it finds two of twenty, giving recall of 10%. Giving the two queries equal weight produces average recall of 30%. Pooling the counts instead produces four found out of twenty-four relevant items, about 16.7%. Both calculations follow their definitions; they give different influence to the two questions.

State which calculation your report uses and retain the per-query results. Elastic recommends evaluating representative requests so that improving one type of query does not hide regressions in another [2]. For a practical review, you might group exact identifiers, broad exploratory requests and ambiguous wording, then inspect each group. Those are proposed categories, not measured proportions of a real workload. A high overall average can coexist with poor performance on a group that matters greatly to your users. Decide whose experience the evaluation is intended to represent before selecting the weighting.

08

Keep a final test separate from repeated tuning

An evaluation set becomes less convincing as a final check if you repeatedly adjust the system to make its scores rise. Scikit-learn's evaluation guidance explains how parameter choices can leak information from a test set and overstate generalization. TREC describes a development stage followed by separate evaluation data [1][5]. The same principle applies when choosing retrieval weights, candidate counts or other settings: the cases used to choose a configuration should not be the only evidence used to assess it.

Use development examples to understand failures and make changes. Then assess the selected configuration on a held-out set whose labels did not guide those changes. If you examine that final set, tune again and report the improved result, be clear that it has now influenced development. Also consider related questions: several small rewrites of the same request may provide less separation than their different text suggests. Scikit-learn discusses group-aware and time-aware splitting when observations have those structures [5]. Apply that idea thoughtfully to your workload instead of assuming a random division automatically creates an independent challenge.

Keep development and final assessment separate. Original retrieval application of held-out evaluation principles. Repeatedly tuning against a test set changes its evidential role.
Original retrieval application of held-out evaluation principles. Repeatedly tuning against a test set changes its evidential role. · Ameer Journal — original explanatory diagramOriginal editorial illustration; no third-party artwork reused.
09

Retrieval success does not certify the later answer

A relevance score compares a returned list with labels. It does not read a generated answer for you. Imagine that our drawing-app search retrieves A, the correct desktop-export instructions, but a later answer mistakenly describes importing a file. The retrieval result can be successful under its labels while the answer fails the user's task. Conversely, an answer could repeat a familiar fact without retrieving the evidence the evaluation expected. These are logical examples of different outputs, not observations about a named system.

Keep separate checks for the questions you actually need to answer: did retrieval find the supporting material, did the response use it accurately, and did the user receive a usable result? TREC's task-specific protocols and Elastic's rated-result metrics illustrate why the evaluated object must be defined [1][2]. The same boundary applies to other qualities. A ranking metric does not directly measure response time, information freshness or access permissions. Record those requirements independently when they matter. A useful dashboard makes each result's scope clear rather than allowing one attractive retrieval percentage to stand for the entire application.

10

Save the contract beside the score

A small evaluation record should identify the collection version, the questions, the relevance policy, the retrieved unit, the cutoff and the scoring rules. Save the original result lists and per-query outcomes, not just the final average. Include the date, the configuration and any unjudged results that need attention. These entries connect the document, request and rating ingredients described by Elastic with the task and protocol information emphasized by TREC [1][2]. They let someone else understand what changed when a later score moves.

Finally, define how difficult cases are reported. If a query has no labeled relevant items, ordinary recall has a zero denominator; do not silently invent a percentage. If the system returns no results, retain the case and apply the declared scoring policy. Keep absent-answer tasks visible as their own requirement when that is part of the product. Our fully labeled toy collection avoids these uncertainties to teach the calculations. Real evaluation becomes useful when it exposes its limits just as clearly: what was tested, what counted as relevant, which failures mattered and what still needs another kind of evidence.

Make the next comparison reproducible. Preserve the run and its limits. The hypothetical arithmetic is a teaching example, not a model benchmark.
Preserve the run and its limits. The hypothetical arithmetic is a teaching example, not a model benchmark. · Ameer Journal — original explanatory diagramOriginal editorial illustration; no third-party artwork reused.
Follow the evidence

Sources & further reading

Explore the references behind this guide. External pages may change after our review.

  1. How To TREC
    NIST TREC · Accessed 6 Nov 2026
  2. Ranking evaluation
    Elastic · Accessed 6 Nov 2026
  3. ndcg_score — scikit-learn 1.9.1 documentation
    scikit-learn · Accessed 6 Nov 2026
  4. Text REtrieval Conference (TREC) Data - English Relevance Judgements
    NIST TREC · Accessed 6 Nov 2026
  5. 3.1. Cross-validation: evaluating estimator performance — scikit-learn 1.9.1 documentation
    scikit-learn · Accessed 6 Nov 2026

Article updated 6 Nov 2026.

Found something we should revisit?

Good explanations get better with thoughtful feedback.

Suggest a correction