-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
label_ranking_average_precision_score fails with sublists that are different sizes #8487
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
What do you intend to mean by that y_true?
…On 2 March 2017 at 08:30, José P. González-Brenes ***@***.***> wrote:
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]]) #3 and 2
y_score = np.array([[0.75, 0.5, 1], [1, 0.2, 0.1]]) # 3 and 2
label_ranking_average_precision_score(y_true, y_score)
This code fails with an exception:
ValueError: setting an array element with a sequence.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#8487>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/AAEz60AJnjuSi045zOkTC9K1jkl3uIAnks5rheN8gaJpZM4MQOkU>
.
|
Hello @jnothman, Not sure I understand your question. y_true is the "correct" answer for every search ranking opportunity. Every sublist is the number of results the user saw. Sometimes the user may see 3 search results, sometimes she may see 2 results, or whatever number. Currently, this metric only works when the user sees the same number of results in every session. If not, a cryptic error is raised. Thanks! |
Scikit-learn doesn't really deal with learning-to-rank problems atm. I'm
inclined to close this issue as out of scope.
…On 2 March 2017 at 11:44, José P. González-Brenes ***@***.***> wrote:
Hello @jnothman <https://github.com/jnothman>,
Not sure I understand your question. y_true is the "correct" answer for
every search ranking opportunity. Every sublist is the number of results
the user saw. Sometimes the user may see 3 search results, sometimes she
may see 2 results, or whatever number.
Currently, this metric only works when the user sees the same number of
results in every session. If not, a cryptic error is raised.
Thanks!
Jose
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#8487 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAEz6wuOAL6iSMuzCTFysmhbO4p_iey8ks5rhhD_gaJpZM4MQOkU>
.
|
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.
This code fails with an exception:
The text was updated successfully, but these errors were encountered: