Normalized discounted cumulative gain
Normalized discounted cumulative gain is a ranking metric that discounts graded relevance by item position and normalizes the result against the ideal ranking.
AI Recommender Systems
NDCG, or normalized discounted cumulative gain, measures ranked retrieval quality by rewarding relevant items more heavily when they appear near the top.
- How it is used
- Evaluates whether a recommender’s scoring stage places relevant items near the top of its ranked list.
- How deep it goes
- Builds from gain through position discounting and DCG to normalization, then shows a metric-loop implementation.
- Examples
- Compares lists with one relevant item at different positions and calculates NDCG at multiple k values.
- What you can do after
- Apply it via ndcg_score and NumPy to compare ranked recommendations at selected list lengths.
Read how AI Recommender Systems explains normalized discounted cumulative gain →
Machine Learning System Design
A ranking metric that discounts relevance gains by position and normalizes them by the ideal discounted cumulative gain.
- How it is used
- Uses NDCG as a fast offline proxy for evaluating search rankings before relying on online outcomes.
- How deep it goes
- Defines NDCG through discounted gains and ideal normalization, but does not derive the position-discount formula.
- Examples
- Scores photo search results with human labels at 10 positions and purchase, favorite, click, or view feedback at 30 positions.
- What you can do after
- Evaluate search rankings using relevance scores and compare offline metrics with online outcomes.
Read how Machine Learning System Design explains normalized discounted cumulative gain →
Retrieval Augmented Generation, The Foundational Ideas
NDCG@10 is normalized discounted cumulative gain computed over the ten highest-ranked retrieval results.
- How it is used
- Measures retrieval quality over ten highest-ranked results when comparing HyDE with lexical, unsupervised dense, and supervised baselines.
- How deep it goes
- Defines the cutoff and reports comparative scores, but does not explain the metric’s formula or discounting calculation.
- Examples
- Uses TREC DL19, TREC DL20, BEIR SciFact, and BEIR FiQA comparison scores.
- What you can do after
- Evaluate retrieval approaches by comparing NDCG@10 scores across benchmarks and baselines.
LLM Evaluation and Alignment, The Foundational Ideas
Normalized discounted cumulative gain is a ranking metric that discounts lower-ranked results and normalizes their graded relevance against an ideal ranking.
- How it is used
- Evaluates retrieval rankings when all relevant documents and graded relevance matter.
- How deep it goes
- Defines rank discounting and ideal-ranking normalization but provides no worked nDCG calculation.
- Examples
- Contrasts documents at ranks 3 and 4 and recommends nDCG for graded shopping-assistant retrieval.
- What you can do after
- Evaluate retrieval rankings and choose nDCG when graded relevance across results matters.
Human-in-the-Loop Machine Learning: Active learning and annotation for human-centered AI
A ranking metric that divides discounted cumulative gain by the ideal discounted cumulative gain.
- How it is used
- Scores annotator rankings of candidate results in information retrieval tasks.
- How deep it goes
- Defines a 0–1 ratio against an ideal ground-truth ranking and normalizes over shown candidates.
- Examples
- Uses basketball web-search and shopping queries to illustrate candidate lists that may be judged by annotators.
- What you can do after
- Evaluate annotator rankings against an ideal ranking for the candidates they saw.
Also covered in
- AI Model EvaluationIn early access (MEAP)
- Build an Advanced RAG Application (From Scratch)In early access (MEAP)
- Effective Conversational AI
What to know first
- precisionPrecision is the proportion of items predicted, selected, or retrieved as positive that are correct or relevant.
- recallRecall is the proportion of all relevant or actual positive items that a system successfully retrieves or correctly identifies.
- relevanceRelevance is the degree to which information, a result, or a response pertains to a query, task, purpose, or information need.
- accuracyAccuracy is the degree to which a result agrees with a specified truth, reference, or criterion, commonly measured as the proportion of evaluated predictions that are correct.
Related concepts
- retrieval rankingmeasures · Retrieval ranking is the ordering of candidate items according to their estimated relevance to a query.
- rank-aware metrickind of · A rank-aware metric quantitatively evaluates the quality of an ordered list relative to desired relevance or preference while accounting for item positions.
- performancekind of · Performance is a measure of how effectively a person, process, model, or system achieves its objectives, including qualities such as output quality, speed, and resource efficiency.
- discounted cumulative gainuses · Discounted cumulative gain is a ranking metric that sums graded relevance gains while reducing the contribution of items at lower positions in a ranked list.
- Precision@kcontrasts with · Precision@k is the proportion of the top k items in a ranked list that are relevant to the query or task.
- evaluation pipelineproduced by · An evaluation pipeline is an organized sequence of steps for assessing a system or its outputs against defined criteria and producing evaluation results.
Questions about normalized discounted cumulative gain
What is normalized discounted cumulative gain?
Normalized discounted cumulative gain is a ranking metric that discounts graded relevance by item position and normalizes the result against the ideal ranking.
Which Manning books explain normalized discounted cumulative gain?
AI Recommender Systems, Machine Learning System Design, Retrieval Augmented Generation, The Foundational Ideas, LLM Evaluation and Alignment, The Foundational Ideas and Human-in-the-Loop Machine Learning: Active learning and annotation for human-centered AI.
What should I know before learning normalized discounted cumulative gain?
Manning books that teach normalized discounted cumulative gain usually introduce precision, recall, relevance and accuracy first.
What is the difference between normalized discounted cumulative gain and Precision@k?
Normalized discounted cumulative gain is a ranking metric that discounts graded relevance by item position and normalizes the result against the ideal ranking. Precision@k is the proportion of the top k items in a ranked list that are relevant to the query or task.
What is normalized discounted cumulative gain a kind of?
Normalized discounted cumulative gain is a kind of rank-aware metric. A rank-aware metric quantitatively evaluates the quality of an ordered list relative to desired relevance or preference while accounting for item positions.
What is normalized discounted cumulative gain also called?
Normalized discounted cumulative gain is also called nDCG.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.




