Skip to content

Added pos_label parameter to roc_auc_score function#2616

Closed
ilblackdragon wants to merge 1 commit intoscikit-learn:masterfrom
ilblackdragon:roc_auc-add-pos_label
Closed

Added pos_label parameter to roc_auc_score function#2616
ilblackdragon wants to merge 1 commit intoscikit-learn:masterfrom
ilblackdragon:roc_auc-add-pos_label

Conversation

@ilblackdragon
Copy link
Copy Markdown

To be able to run roc_auc_score on binary tagets that aren't {0, 1} or {-1, 1}.

… it on binary tagets that aren't {0, 1} or {-1, 1}.
@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage remained the same when pulling 6ffd0be on ilblackdragon:roc_auc-add-pos_label into f642aee on scikit-learn:master.

@jaquesgrobler
Copy link
Copy Markdown
Member

+1 for merge 👍

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still true?

Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arjoly How does #2460 will handle binary case? 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)?

Copy link
Copy Markdown
Member

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.

@arjoly
Copy link
Copy Markdown
Member

arjoly commented Dec 3, 2013

I think that you should have a look to the pr #2610 of @jnothman. Should we switch to a labels arguments instead of a pos_label one? Note that you should add tests for your new feature. Have a look at sklearn/metrics/tests/test_metrics.py.

@amueller
Copy link
Copy Markdown
Member

closing this as no reply, also it's replaced by #6874.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants