Evaluation
How to measure the quality of a ranking against a ground truth: P@k, AP and MAP for binary relevance, nDCG for graded relevance, bpref for incomplete judgments, and avoiding overfitting by a train/test split.
Concepts#
- Ground Truthrelevant documents per query; with the queries it forms a benchmark start here
- Precision at kP@k and P@R, fraction of relevant hits in the top / top
- Average Precisionmean of P@ over all relevant documents (0 for missing ones)
- Mean Average Precisionmean of AP (and P@k, P@R) over a benchmark
- Discounted Cumulative Gaingraded relevance with position discount, normalized by the ideal ranking
- BPrefrobust to incomplete judgments, uses only judged documents
- Overfitting (IR Evaluation)tuning on the evaluation benchmark inflates scores; use a training/test split
How it fits together#
Pick the measure by what the ground truth looks like:
| Ground truth | Measure | Looks at | Weakness |
|---|---|---|---|
| binary, complete | P@k | top only | ignores order in the top and everything below |
| binary, complete | P@R | top ( = number of relevant) | same, but cut-off adapts to the query |
| binary, complete | AP | all relevant documents, rewards early ranks | needs complete judgments; missing relevant documents count 0 |
| graded, complete | nDCG@k | top , grade and position | needs the ideal ranking, i.e. complete judgments |
| incomplete (pooling) | bpref | judged documents only | ignores unjudged hits entirely |
Relations between them: AP is the average of P@k at the relevant positions; AP iff all relevant documents precede all non-relevant ones, which also gives P@R (but not conversely for AP with a short list, see the exam true/false question). nDCG generalizes the idea of AP to grades, bpref replaces “number of non-relevant documents above” by a capped count over judged ones.
Per query vs. per system. P@k, AP, nDCG, bpref rate one result list; averaging over all queries of the benchmark gives MP@k, MP@R, MAP (Mean Average Precision), which rate the system. The ground truth is a set but the results a ranked list; there is no natural cut-off or full order to compare directly, hence these measures (DBIS_VL02 > Set vs. Ranked List).
Honest evaluation. Parameters such as of BM25 are tuned on a training benchmark; the test benchmark is used once at the end (Overfitting (IR Evaluation)). Typical numbers (ES2): baseline MAP 42 %, best tuned 48 %.
Typical exam tasks. Compute the measures for a given result list, construct a relevance set that gives prescribed P@R and P@4 (Exam WS 22/23, see DBIS_VL13 > Example Task: Ranking and Precision (WS 22/23, Task 3.1, 8 points)), write ap/dcg/ndcg functions, and prove AP iff relevant documents come first. Pitfall: the divisor of AP is , not the number of retrieved relevant documents. The rankings being evaluated come from Inverted Index and Ranking.
Key Formulas#
- , — Precision at k
- — Average Precision
- — Mean Average Precision
- , — Discounted Cumulative Gain
- — BPref
Exercises & Exam Questions#
Worked exam questions on these measures (WS 23/24 Task 1.3, WS 17/18 Task 1.1–1.2, WS 22/23 Task 3.1) are in Inverted Index and Ranking > Exercises & Exam Questions and DBIS_VL13; the concept notes contain the worked examples.
| Semester | Task | Points | Subtopics |
|---|---|---|---|
| WS-1516 (not published) | Task 1 | 20pts | dot-product similarity, AP, rank decomposition |
| WS-1617 (not published) | Task 1 | 20pts | P@2, AP |
| WS-1718 (not published) | Task 1 | 20pts | P@2, P@R, AP, DCG, nDCG |
| WS-1819 (not published) | Task 1 | 25pts | nDCG |
| DBIS Exam WS2122 (not published) | Task 1 | 25pts | P@k |
| DBIS Exam WS2324 (not published) | Task 1 | 20pts | P@2, P@R, AP, DCG |
Lectures#
- DBIS_VL02 — ground truth, P@k, AP, MAP, nDCG, bpref, overfitting, set vs. ranked list
- DBIS_VL13 — example exam task combining dot-product ranking, P@R and AP
Related Topics#
- Inverted Index and Ranking — produces the rankings that are evaluated here