liveBook · Manning

Normalized discounted cumulative gain

Also called nDCG

Normalized discounted cumulative gain is a ranking metric that discounts graded relevance by item position and normalizes the result against the ideal ranking.

How 5 Manning books explain it

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.

Read how Retrieval Augmented Generation, The Foundational Ideas explains normalized discounted cumulative gain →

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.

Read how LLM Evaluation and Alignment, The Foundational Ideas explains normalized discounted cumulative gain →

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.

Read how Human-in-the-Loop Machine Learning: Active learning and annotation for human-centered AI explains normalized discounted cumulative gain →

Also covered in

What to know first

Related concepts

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.