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

