8000 Simplified error message in get_scorer() function in sklearn.metrics.scorer.py file by princejha95 · Pull Request #11062 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

Simplified error message in get_scorer() function in sklearn.metrics.scorer.py file #11062

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 3 commits into from

Conversation

princejha95
Copy link
@princejha95 princejha95 commented May 3, 2018

Reference Issues/PRs

Fixes #10712

8000

What does this implement/fix? Explain your changes.

Simplified error message in get_scorer() function in sklearn.metrics.scorer.py file. Now the error message displays what the user needs to do if he gives a wrong scoring value in get_scorer() function.

Any other comments?

@qinhanmin2014
Copy link
Member

(1) Please remember to link the issue in PR description (See the template or contributing guide)
(2) There're still some irrelevant changes
(3) You also need to update relevant doc (e.g., model_evaluation.rst)

@princejha95
Copy link
Author

Can you please elaborate "irrelevant changes" ? I am not getting it.

8000

@rth
Copy link
Member
rth commented May 3, 2018

Can you please elaborate "irrelevant changes" ? I am not getting it.

See the diff at https://github.com/scikit-learn/scikit-learn/pull/11062/files there are changes that are unrelated to fixing the error message.

@princejha95
Copy link
Author
princejha95 commented May 3, 2018 via email

@qinhanmin2014
Copy link
Member

@princejha95 You should refer to the diff of the PR, not a single commit.

@rth
Copy link
Member
rth commented May 3, 2018

In other words, we can only merge a pull request, not individual commits. You need to add more commits 8000 to revert the changes until the diff of the Pull Request looks right. Don't worry about individual commits too much, everything will be squashed into a single commit when merging..

@@ -236,8 +231,8 @@ def get_scorer(scoring):
valid = False # Don't raise here to make the error message elegant
if not valid:
raise ValueError('%r is not a valid scoring value. '
'Valid options are %s'
% (scoring, sorted(scorers)))
'For valid options use sorted(SCORERS.keys())'
Copy link
Member

Choose a reason for hiding this comment

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

Maybe should make this sklearn.metrics.SCORERS instead of just SCORERS

@princejha95
Copy link
Author
princejha95 commented May 4, 2018 via email

@princejha95
Copy link
Author
princejha95 commented May 4, 2018 via email

@amueller
Copy link
Member

Still unrelated changes in the file.

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.

Add a list_scorers function to sklearn.metrics
5 participants
0