liveBook · Manning

Normalized discounted cumulative gain

As explained in Machine Learning System Design

A ranking metric that discounts relevance gains by position and normalizes them by the ideal discounted cumulative gain.

Normalized discounted cumulative gain (NDCG) measures the quality of ranked results, such as photos returned by a search engine. It discounts relevance gains by position and normalizes discounted cumulative gain (DCG) by the ideal DCG. NDCG@N evaluates the first N results. section 5.3.2 section 12.4.2

NDCG can serve as a fast offline proxy for online measures such as click-through rate and conversion rate. Its usefulness depends on the relevance scores: human labels require collection effort, while implicit feedback reflects observed user interactions. section 5.3.2 section 12.4.2

Evaluating photo search

For NDCG@10, use human-labeled relevance scores for the photos on a search results page. For NDCG@30, use implicit scores: 3 for an image bought, 2 for one added to favorites, 1 for one clicked, and 0 for a view without interaction. section 12.4.2

To check whether an offline metric is a useful proxy, apply it retrospectively to saved search results and compare it with online metrics across time periods using Spearman’s rank correlation. Future A/B tests can track whether differences in offline metrics correspond to changes in online outcomes. section 12.4.2

How Machine Learning System Design covers it

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.
How it connects
Connects NDCG to mean reciprocal rank, click-through rate, conversion rate, Spearman’s rank correlation, and A/B testing.

Also explained in

Compare how 2 books explain normalized discounted cumulative gain →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Machine Learning System Design. The section links point to the parts of the book it draws on.