Closed
Description
I'm trying to calculate the NDCG score for binary relevance:
from sklearn import metrics
# test 1
y_true = [[3]]
y_score = [[5]]
metrics.ndcg_score(y_true, y_score)
And getting error
ValueError: Only ('multilabel-indicator', 'continuous-multioutput', 'multiclass-multioutput') formats are supported. Got binary instead
Below code snippet is working which has more than 1 item. Please suggest why single item array is not working.
from sklearn import metrics
# test 1
y_true = [[6 ,5, 4, 3, 2, 1]]
y_score = [[120, -2, -6, -3, 2, 12]]
metrics.ndcg_score(y_true, y_score)