Skip to content

FIX make it possible to specify the positive label in roc_auc_score #18107

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

Closed
wants to merge 7 commits into from

Conversation

glemaitre
Copy link
Member

closes #17572
closes #17704

@glemaitre glemaitre marked this pull request as draft August 6, 2020 07:49
average_precision_score, needs_threshold=True,
)
with pytest.raises(ValueError):
average_precision_scorer(classifier, X_test, y_test)
Copy link
Member

@ogrisel ogrisel Aug 6, 2020

Choose a reason for hiding this comment

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

Please also check the message to make the test easier to follow.


pos_label = "cancer"
y_proba = y_proba[:, 0]
y_decision_function *= -1
Copy link
Member

Choose a reason for hiding this comment

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

Maybe add a line such as:

assert classifier.classes_[0] == pos_label

to make the test easier to follow.

@glemaitre
Copy link
Member Author

OK, so it seems that I figure out some of the stuffs. I will close all my PRs and open the following:

  • Improve the documentation of the roc_auc_score. There is actually no bug there but the documentation could be more explicit. (We might rediscuss about the semantic of y_score but it would require much more work and API changes);
  • Solve the issue in the Scorer classes to take into account the pos_label when it is passed to make_scorer;
  • Improve the documentation regarding the last point.

@glemaitre glemaitre closed this Aug 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue in roc_auc_score which make wrong assumption of positive class
2 participants