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

Arg normalize to sklearn.linear_model.LinearRegression has been removed in version 1.2 #1035

Closed
carlsmedstad opened this issue May 14, 2023 · 3 comments
Labels

Comments

@carlsmedstad
Copy link
Contributor

Describe the bug

The following will fail for scikit-learn version 1.2:

sklearn.linear_model.LinearRegression(normalize=True)

Docs for 1.0: https://scikit-learn.org/1.0/modules/generated/sklearn.linear_model.LinearRegression.html?highlight=linearregression#sklearn.linear_model.LinearRegression

Docs for 1.2: https://scikit-learn.org/1.2/modules/generated/sklearn.linear_model.LinearRegression.html?highlight=linearregression#sklearn.linear_model.LinearRegression

@carlsmedstad
Copy link
Contributor Author

After these changes the test pass:

sed -i 's/LinearRegression(normalize=True)/LinearRegression()/g' \
  mlxtend/regressor/tests/test_stacking_regression.py \
  mlxtend/regressor/tests/test_stacking_cv_regression.py

@namanmistry
Copy link
Contributor

Hey, In the old docs of sklearn for normalize parameter it was written:

This parameter is ignored when fit_intercept is set to False. If True, the regressors X will be normalized before regression by subtracting the mean and dividing by the l2-norm. 

And fit_intercept defaults to True in the newer version of sklearn. So can we directly remove normalize argument? I think it wont effect the functionality because it is still normalizing.

@rasbt
Copy link
Owner

rasbt commented May 18, 2023

Thanks for the note & thanks for addressing that in PR #1036!

@rasbt rasbt closed this as completed May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants