DCG (Discounted Cumulative Gain)#
A ranking metric that rewards relevant items more when ranked higher.
Important
✨ AI-generated content. This page was written with the assistance of an AI language model and is provided as a learning aid. Despite careful review, it may still contain mistakes, omissions, or out-of-date information. Whether you are new to the topic, a team lead, or a senior practitioner, treat it as a starting point rather than an authoritative reference: read it critically and independently verify anything you act on (code, commands, figures, and factual claims) against official documentation and primary sources before relying on it.
What it is#
Discounted Cumulative Gain scores a ranked list by summing each item’s graded relevance, discounted by how far down it sits — so a relevant result near the top counts far more than the same result buried lower:
The logarithmic discount encodes that users examine top results most.
Why it beats precision#
Unlike binary precision / recall, DCG uses multi-level relevance (say 0–3) and position, capturing both how relevant each item is and where it was ranked — exactly what matters for search and recommendation.
Normalizing it#
Raw DCG isn’t comparable across queries with different numbers of relevant items, so \(\text{NDCG} = \text{DCG} / \text{IDCG}\) divides by the ideal DCG (the best possible ordering), giving a 0-to-1 score where 1 is a perfect ranking. It is the standard offline ranking metric.
Theme: Ranking & Interleaving · All terminology
Hint
Mind map — connected ideas
Kaggle · TREC (Text REtrieval Conference) · Average Precision (AP) · Relevance in Recommender Systems · Intra-List Diversity (ILD) · Cosine Similarity of Item Features
Hint
More in Ranking & Interleaving
Balanced Interleaving · Interleaving Tests · Mean Average Precision (MAP) · NDCG (Normalized Discounted Cumulative Gain) · Probabilistic Interleaving · Ranking Algorithms · Team Draft Interleaving (TDI) · TREC (Text REtrieval Conference)
See also
Source article Adapted (context, re-expressed) in our own words from: DCG (Discounted Cumulative Gain) (insightful-data-lab.com).