You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The evaluation function label_ranking_average_precision_score fails when the sublists are of different sizes. Although I understand that this may be out of implementation convenience, I think this should be documented or at least a more adequate error should be raised.
import numpy as np
from sklearn.metrics import label_ranking_average_precision_score
y_true = np.array([[1, 0, 0], [0, 1]]) #sublists have 3 and 2 elements
y_score = np.array([[0.75, 0.5, 1], [1, 0.1]]) #sublists have 3 and 2 elements
label_ranking_average_precision_score(y_true, y_score)
This code fails with an exception:
ValueError: setting an array element with a sequence.