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

fix: support "squared" argument for sklearn>=1.6.1 #662

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

Conversation

JohnGiorgi
Copy link

@JohnGiorgi JohnGiorgi commented Feb 6, 2025

The mse metric is broken when using scikit-learn>1.5.2. This is because the squared argument was removed from mean_squared_error. I believe a simple, backwards compatible fix (up to scikit-learn==1.5.2) is just to call out to mean_squared_error when squared=True and root_mean_squared_error otherwise.

I didn't find any MSE specific unit tests so I just ran all the doc string examples and they return the correct responses.

Fixes: #663

scikit-learn>=1.5.2
Copy link
Author

@JohnGiorgi JohnGiorgi Feb 6, 2025

Choose a reason for hiding this comment

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

I am not seeing root_mean_squared_error in versions earlier than this, hence the new min requirement version

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.

MSE, r_squared not working, QUICK FIX (squared argument is deprecated in call to scikit-learn)
1 participant