Ranking discounted gain calculator

Calculate NDCG at supplied cutoff and discounted cumulative gain with your own figures.

Your numbers

Use the units shown. Results update as you change valid inputs.

Use NDCG at supplied cutoff and discounted cumulative gain to compare changes to your inputs. The method and limits below explain the scope.

Examples

Examples

Try the starting example

Supplied ranking relevance in displayed order
3,2,0,1
Cutoff k (whole number)
3
Gain convention: exponential or linear
exponential
NDCG at supplied cutoff
0.946768
Discounted cumulative gain
8.892789
Ideal DCG within supplied candidate pool
9.392789
Effective cutoff
3

Try another scenario

Supplied ranking relevance in displayed order
3,2,0,1
Cutoff k (whole number)
3
Gain convention: exponential or linear
linear
NDCG at supplied cutoff
0.894999
Discounted cumulative gain
4.26186
Ideal DCG within supplied candidate pool
4.76186
Effective cutoff
3
Calculation method

Calculation method

NDCG at supplied cutoff

DCG/ideal DCG; explicitly 0 when ideal gain is 0.

Discounted cumulative gain

Sum gain(relevance)/log2(rank+1), starting at rank 1.

Ideal DCG within supplied candidate pool

Sort only supplied relevance values descending before applying the same gain and cutoff.

Effective cutoff

Minimum of supplied k and candidate count.

Symbols and units
a
Supplied ranking relevance in displayed order
b
Cutoff k (whole number)
c
Gain convention: exponential or linear

Use the units shown. A list keeps the order in which you enter its values. The symbol ^ means “raised to the power of”.

Assumptions & limits

Assumptions & limits

  • Ranking relevance must be supplied; no relevance judgments are inferred. Ideal ranking is restricted to the supplied pool, gain is explicit, and zero ideal gain uses an explicit NDCG convention of 0.
Are these inputs private?

These calculations run in your browser. A shared link contains the values you choose to share. Only questions submitted to the separate AI finder are sent to OpenAI.

Further reading

scikit-learn: ndcg_score ↗

Background reading; this does not imply endorsement or independent review of SumFizz.

Share this page
Share this calculator

Leave unchecked to share the page without your entered values.