[go: nahoru, domu]

Skip to content
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

Registering neg_root_mean_squared_log_error in sklearn.metrics.SCORERS #20908

Closed
helper-uttam opened this issue Sep 1, 2021 · 4 comments
Closed

Comments

@helper-uttam
Copy link
Contributor

Describe the workflow you want to enable

As I had added root_mean_squared_log_error previously in #20326 . Now I want to register the same in sklearn.metrics.scorers . You can see #20326 (review) for better understanding.

Describe your proposed solution

The solution is to add a parameter named squared which will be false by default and when it'll be set to true then the function will return root of mean_squared_log_error .

Describe alternatives you've considered, if relevant

No response

Additional context

No response

@glemaitre
Copy link
Member

I think that it makes sense. It should follow the other pattern and potentially add a test if there is not an already common test.

@helper-uttam
Copy link
Contributor Author
helper-uttam commented Sep 2, 2021

I think that it makes sense. It should follow the other pattern and potentially add a test if there is not an already common test.

I couldn't find the code where neg_root_mean_squared_error is defined in scorer.py.

It would be really helpful if you can leave a link for the code where neg_root_mean_squared_error is defined.

@glemaitre
Copy link
Member

I couldn't find the code where neg_root_mean_squared_error is defined in scorer.py.

As you mentioned it is not defined. So you can create a PR to create the scorer.

So as I mentioned, you can use the same pattern than other scorer, something like:

neg_root_mean_squared_error = make_scorer(mean_squared_error, greater_is_better=False, squared=False)

For the test, I checked and you will need to add the neg_root_mean_squared_error in the REGRESSION_SCORERS such that it is tested.

@helper-uttam
Copy link
Contributor Author

I couldn't find the code where neg_root_mean_squared_error is defined in scorer.py.

As you mentioned it is not defined. So you can create a PR to create the scorer.

So as I mentioned, you can use the same pattern than other scorer, something like:

neg_root_mean_squared_error = make_scorer(mean_squared_error, greater_is_better=False, squared=False)

For the test, I checked and you will need to add the neg_root_mean_squared_error in the REGRESSION_SCORERS such that it is tested.

Sorry, this has been implemented already, I had closed this issue now .

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

No branches or pull requests

2 participants