Skip to content

MAINT Clean up deprecations for 1.8: scoring='max_error' #31753

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

natmokval
Copy link
Contributor

Towards #29462

removed deprecated (renamed to neg_max_error) scoring=max_error

Copy link

github-actions bot commented Jul 13, 2025

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: 89a8cfc. Link to the linter CI: here

@StefanieSenger StefanieSenger self-requested a review July 14, 2025 11:32
Copy link
Contributor

@StefanieSenger StefanieSenger left a comment

Choose a reason for hiding this comment

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

Thanks a lot @natmokval! 🚀

I think we can now fully remove the defined max_error_scorer in the _SCORERS dict.
Apart from that little thing, I think that clean-up is fine and complete.

@@ -735,13 +722,6 @@ def make_scorer(
r2_scorer = make_scorer(r2_score)
neg_max_error_scorer = make_scorer(max_error, greater_is_better=False)
max_error_scorer = make_scorer(max_error, greater_is_better=False)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can remove the defined max_error_scorer (from currently line 724) as well.
It is not not used anywhere anymore.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I’ve now removed the max_error_scorer as you suggested (currently line 724). Thanks for your help!

@natmokval
Copy link
Contributor Author

Thanks a lot @natmokval! 🚀

I think we can now fully remove the defined max_error_scorer in the _SCORERS dict. Apart from that little thing, I think that clean-up is fine and complete.

Thanks @StefanieSenger for reviewing this PR. I couldn’t find max_error_scorer in the _SCORERS dictionary — it looks like it was removed during deprecation.

Copy link
Contributor

@StefanieSenger StefanieSenger left a comment

Choose a reason for hiding this comment

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

That looks very good. Thanks again, @natmokval! Approving.

Would you be so kind to help me with understanding something? I wonder which AI tool you were using and how it worked to produce this comment:

Thanks @StefanieSenger for reviewing this PR. I couldn’t find max_error_scorer in the _SCORERS dictionary — it looks like it was removed during deprecation.

Since you have just removed max_error_scorer from the _SCORERS dict with your last commit 89a8cf, it obviously was there and had not already been removed with the deprecation. Therefore, I find this comment confusing.

When in the process was it produced and by which tool? Thanks for your help.

@natmokval
Copy link
Contributor Author

natmokval commented Jul 14, 2025

That looks very good. Thanks again, @natmokval! Approving.

Would you be so kind to help me with understanding something? I wonder which AI tool you were using and how it worked to produce this comment:

Thanks @StefanieSenger for reviewing this PR. I couldn’t find max_error_scorer in the _SCORERS dictionary — it looks like it was removed during deprecation.

Since you have just removed max_error_scorer from the _SCORERS dict with your last commit 89a8cf, it obviously was there and had not already been removed with the deprecation. Therefore, I find this comment confusing.

When in the process was it produced and by which tool? Thanks for your help.

Thanks @StefanieSenger for the comment. I used a tool called Natural Intelligence.
Here's a part of the diff between main and the commit with the deprecataion

@@ -850,7 +867,7 @@ fowlkes_mallows_scorer = make_scorer(fowlkes_mallows_score)
 _SCORERS = dict(
     explained_variance=explained_variance_scorer,
     r2=r2_scorer,
-    neg_max_error=neg_max_error_scorer,
+    max_error=max_error_scorer,

I understand this as removingmax_error_scorer from the _SCORERS, of course I can be wrong.

Unfortunately, I did not find a way to show code changes from another PR directly in my comment, but you can see that I mean here:
https://github.com/scikit-learn/scikit-learn/pull/29462/files#diff-dfa830b15d3c3d544f99c5d022b7fb6067d97f3ff0289002291e78b65b02ec58L867-L870

@StefanieSenger
Copy link
Contributor

StefanieSenger commented Jul 14, 2025

Hi @natmokval,

ah my bad, I didn't even mean _SCORERS but the pre-defined list of standard regression scores. I had just thought it was in _SCORERS, probably because I clicked around too much. Very sorry about that.

And thanks for sharing the tool you used. It helps me understand.

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.

2 participants