1
$\begingroup$

I need to apply NDCG over the results of a recommender algorithm, but was not able to find any proper example that suits my use case in order to find out if my implementation is correct.

Here is my test set:

id | p_name | relevance
1  | p3     | 1
2  | p4     | 1
3  | p7     | 0
4  | p9     | 1

And a result set:

id | p_name | relevance
1  | p1     | 3.00
2  | p2     | 2.70
3  | p3     | 2.10
4  | p4     | 1.99
5  | p5     | 1.59
6  | p6     | 1.20
7  | p7     | 0.50

As a result I got: IDCG = 2.06, DCG = 9.347 and nDCG = 4.533. Just wanted to check, are my results are correct?

$\endgroup$
  • $\begingroup$ nDCG cannot be more than 1. There seems to be something wrong. $\endgroup$ – aneesh joshi May 22 '18 at 11:45
  • $\begingroup$ Can you please outline how you came to these values? As mentioned, having an idealised DCG that is lower than the realised now, is impossible so this immediately appears as a big red flag. $\endgroup$ – usεr11852 Feb 23 at 0:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.