🔎  DCG (Discounted Cumulative Gain)

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:

\[\text{DCG}_p = \sum_{i=1}^{p} \frac{\mathrm{rel}_i}{\log_2(i+1)}.\]

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



See also

Source article Adapted (context, re-expressed) in our own words from: DCG (Discounted Cumulative Gain) (insightful-data-lab.com).

Tags: purpose: reference topic: terminology level: advanced