8000 "normalize" parameter in sklearn.linear_model should be "standardize" · Issue #16445 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content
"normalize" parameter in sklearn.linear_model should be "standardize" #16445
Closed
@PythonRSAS

Description

@PythonRSAS

Describe the issue linked to the documentation

In different sklearn.linear_model classes such as ridge and ridgeCV, the normalize parameter means actually standardize. This misnomer can cause lots of unnecessary confusion.

What normalize means in general is to make the length of vector norm 1. This is clearly not ridge regression or lasso or other regularized linear model does.

Suggest a potential alternative/fix

rename the parameter as standardize instead.

Please see the discussion here:
https://stackoverflow.com/questions/60216879/what-does-sklearn-linear-model-ridgecv-normalize-parameter-exactly-do/60233425#60233425

from sklearn.datasets import load_boston
dataset =load_boston()
X =dataset.data
y=dataset.target

clf = RidgeCV(normalize=True,alphas=[1e-3, 1e-2, 1e-1, 1]).fit(X, y)
clf.coef_
print(clf.alpha_)
print(clf.score(X,y))
print(clf.coef_)
coef =pd.DataFrame(zip(dataset.feature_names,clf.coef_)) #match SAS

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0