liveBook · Manning

Discounted cumulative gain

As explained in AI Recommender Systems

Discounted cumulative gain is a ranking metric that sums relevance gains after reducing the contribution of items appearing lower in the list.

Discounted cumulative gain (DCG) evaluates a ranked recommendation list by summing relevance gains while reducing the contribution of items farther down the list. Unlike ordinary cumulative gain, it distinguishes a relevant item at position 1 from one at position 7. section 4.6.3

A practical DCG calculation proceeds as follows:

  • Assign each item a gain: use binary relevance such as consumed versus not consumed, or graded relevance such as ratings or profit. section 4.6.3
  • Apply a positional discount, commonly logarithmic: position 1 contributes 1.0, position 2 about 0.63, and position 3 about 0.5. section 4.6.3
  • Sum the discounted gains through rank k to obtain DCG@k. section 4.6.3
  • Normalize by ideal DCG when comparing users or evaluations with different numbers of relevant items; this produces nDCG@k. section 4.6.3
Figure 4.14 A simple way to calculate Gain is simply saying an item is relevant if the user consumed it or not. This means that the two lists of recommendations would have the same cumulative gain.

Compare recommendation lists containing the same relevant items but placing them at different ranks. section 4.6.3

How AI Recommender Systems covers it

How deep it goes
Defines gain, logarithmic discounting, DCG, and normalization, then stops short of a complete derivation.
Examples
Uses recommendation lists with identical relevant items at different positions and compares metrics across cutoff values.
What it assumes
Assumes ranked recommendation lists and relevance labels, while defining gain from binary relevance upward.
What you can do after
Evaluate recommendation lists with DCG or nDCG at selected cutoff positions.
How it connects
Connects relevance, cumulative gain, ranking, ideal DCG, and normalized discounted cumulative gain.

Also explained in

Compare how 2 books explain discounted cumulative gain →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of AI Recommender Systems. The section links point to the parts of the book it draws on.