-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Added pos_label parameter to roc_auc_score function #2616
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
Added pos_label parameter to roc_auc_score function #2616
Conversation
… it on binary tagets that aren't {0, 1} or {-1, 1}.
+1 for merge 👍 |
@@ -365,7 +365,7 @@ def auc_score(y_true, y_score): | |||
return roc_auc_score(y_true, y_score) | |||
|
|||
|
|||
def roc_auc_score(y_true, y_score): | |||
def roc_auc_score(y_true, y_score, pos_label=None): | |||
"""Compute Area Under the Curve (AUC) from prediction scores | |||
|
|||
Note: this implementation is restricted to the binary classification task. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this still true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes since this pr is waiting to be merged #2460
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does #2460 will handle binary case?
As it is at the moment, I haven't change the logic around the positive label handling.
Will it still return one value for "positive" class or return ROC for both classes (i.e. no need in pos_label in this case)?
It detects if y_true and y_score are in multilabel-indicator format. In that case, there isn't any ambiguity on the number of classes/labels. The format checking can be easily done by checking the number of dimension of y_true/y_score. Note taht It doesn't handle the problematic multiclass task.
Depending on the chosen averaging option, you will get one value for all binary tasks or one for each task.
I think that you should have a look to the pr #2610 of @jnothman. Should we switch to a |
closing this as no reply, also it's replaced by #6874. |
To be able to run
roc_auc_score
on binary tagets that aren't {0, 1} or {-1, 1}.