I'm unable to understand the input format of sklearn nDcg: http://sklearn.apachecn.org/en/0.19.0/modules/generated/sklearn.metrics.ndcg_score.html
Currently I have the following problem: I have multiple queries for each of which the ranking probabilities have been calculated successfully. But now the problem is calculating nDCG for the test set for which I would like to use the sklearn nDcg. The example given on the link
>>> y_true = [1, 0, 2]
>>> y_score = [[0.15, 0.55, 0.2], [0.7, 0.2, 0.1], [0.06, 0.04, 0.9]]
>>> ndcg_score(y_true, y_score, k=2)
1.0
According to site, y_true is ground truth and y_score are the probabilities.So following are my questions:
- Is this example for just one query or multiple queries?
- If this is for just one query then what does y_true represents: original rankings?
- If this is for a single query and why we have multiple input probabilites?
- How this method can be applied to multiple queries and their resultant probabilites?