Skip to content

FIX improve error message with string-encoded target in metrics #18192

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

Merged
merged 10 commits into from
Sep 2, 2020

Conversation

glemaitre
Copy link
Member

This test makes sure that we fail with a human-understandable message when the target y_true or the predictions y_pred are encoded as strings.

@glemaitre glemaitre marked this pull request as draft August 19, 2020 08:23
@glemaitre glemaitre changed the title [WIP] TST make consistent error for metric having pos_label FIX improve error message with string-encoded target when used in metrics Aug 19, 2020
@glemaitre glemaitre marked this pull request as ready for review August 19, 2020 09:57
@glemaitre
Copy link
Member Author

The failure in brier_score_loss is expected and should be handled properly after merging #18183

Copy link
Member

@thomasjpfan thomasjpfan left a comment

Choose a reason for hiding this comment

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

Thank you for the PR @glemaitre !

Copy link
Member

@thomasjpfan thomasjpfan left a comment

Choose a reason for hiding this comment

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

Test still failing. (brier_score_loss sure likes using max() and min())

@glemaitre
Copy link
Member Author

I opened #18307 and comment out the test with brier_score_loss with a comment linked to the future discussion. I think this is the more sensible thing to do to have thing moving forward.

@glemaitre
Copy link
Member Author

@thomasjpfan We need to convert into a list the label NumPy array because we will fall into the FutureWarning from NumPy and there is no easy solution there. Since it just make a copy of the labels, the overhead is not so bad.

Copy link
Member

@thomasjpfan thomasjpfan left a comment

Choose a reason for hiding this comment

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

Minor comment. Otherwise LGTM

glemaitre and others added 2 commits September 2, 2020 10:18
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
@thomasjpfan thomasjpfan changed the title FIX improve error message with string-encoded target when used in metrics FIX improve error message with string-encoded target in metrics Sep 2, 2020
@thomasjpfan thomasjpfan merged commit a54cb47 into scikit-learn:master Sep 2, 2020
jayzed82 pushed a commit to jayzed82/scikit-learn that referenced this pull request Oct 22, 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.

3 participants