DCG@k = sum_{i=1..k} (2^rel_i - 1) / log2(i + 1) and
NDCG@k = DCG@k / IDCG@k, where IDCG@k re-sorts the same
relevances descending. An all-zero relevance list has IDCG = 0;
NDCG is then undefined and is refused rather than reported as a
perfect 1.
References
Jarvelin and Kekalainen (2002), ACM TOIS 20(4), 422-446, doi:10.1145/582415.582418 .
Examples
Ndcg(pred_rank = c(1, 2, 3, 4, 5, 6, 7, 8), relevant = c(1, 2, 3, 4, 5, 6, 7, 8), k = 5L)
#> $estimate
#> [1] 1
#>
#> $dcg
#> [1] 2.948459
#>
#> $idcg
#> [1] 2.948459
#>
#> $k
#> [1] 5
#>
#> $n
#> [1] 8
#>
#> $method
#> [1] "NDCG@k (Jarvelin and Kekalainen 2002)"
#>
#> attr(,"class")
#> [1] "morie_rich_result" "list"
