-
-
Notifications
You must be signed in to change notification settings - Fork 26.5k
DEP deprecates 'normalize' in _omp.py #17750
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
DEP deprecates 'normalize' in _omp.py #17750
Conversation
sklearn/linear_model/_omp.py
Outdated
| @_deprecate_positional_args | ||
| def __init__(self, *, n_nonzero_coefs=None, tol=None, fit_intercept=True, | ||
| normalize=True, precompute='auto'): | ||
| normalize='deprecate', precompute='auto'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| normalize='deprecate', precompute='auto'): | |
| normalize='deprecated', precompute='auto'): |
sklearn/linear_model/_omp.py
Outdated
| " removed in 0.26. If you wish to keep an equivalent" | ||
| " behaviour, use Pipeline with a StandardScaler in a" | ||
| " preprocessing stage:" | ||
| " model = make_pipeline( \n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure that using \n will make the rendering better (we don't know our users screen width)
sklearn/linear_model/_omp.py
Outdated
| " removed in 0.26. If you wish to keep an equivalent" | ||
| " behaviour, use Pipeline with a StandardScaler in a" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| " removed in 0.26. If you wish to keep an equivalent" | |
| " behaviour, use Pipeline with a StandardScaler in a" | |
| " removed in 0.26. If you wish to normalize the inputs," | |
| " use a Pipeline with a StandardScaler in a" |
sklearn/linear_model/_omp.py
Outdated
| else: | ||
| _normalize = self.normalize | ||
|
|
||
| if not _normalize: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure we can go from normalize=True to removing the parameter with no normalization in one single cycle: with the current implementation, there is no way to avoid the warnings.
It seems that we should first change the default from True to False, and then remove the parameter?
|
Thanks @NicolasHug for your comments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few suggestions to fix the failures on the CI?
With those patches, the following passes:
pytest -Werror::DeprecationWarning -Werror::FutureWarning -Wignore:tostring:DeprecationWarning sklearn/linear_model/tests/test_omp.pyCo-authored-by: Julien Jerphanion <[email protected]>
lorentzenchr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor comments.
Co-authored-by: Christian Lorentzen <[email protected]>
|
@lorentzenchr @rth @glemaitre this one should be good to go. |
rth
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @maikia @agramfort !
|
Nice! Thanks @maikia, @agramfort and everyone involved in the review! |
Towards: #3020
It deprecates 'normalize' in _omp.py
OrthogonalMatchingPursuit
OrthogonalMatchingPursuitCV