Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@maikia
Copy link
Contributor

@maikia maikia commented Jun 26, 2020

Towards: #3020

It deprecates 'normalize' in _omp.py
OrthogonalMatchingPursuit
OrthogonalMatchingPursuitCV

@_deprecate_positional_args
def __init__(self, *, n_nonzero_coefs=None, tol=None, fit_intercept=True,
normalize=True, precompute='auto'):
normalize='deprecate', precompute='auto'):
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
normalize='deprecate', precompute='auto'):
normalize='deprecated', precompute='auto'):

" 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"
Copy link
Member

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)

Comment on lines 666 to 667
" removed in 0.26. If you wish to keep an equivalent"
" behaviour, use Pipeline with a StandardScaler in a"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
" 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"

else:
_normalize = self.normalize

if not _normalize:
Copy link
Member

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?

@maikia
Copy link
Contributor Author

maikia commented Jun 30, 2020

Thanks @NicolasHug for your comments.
This is still WIP. However please feel free to comment on #17743
Here, I plan to be consistent with what is decided there.

Base automatically changed from master to main January 22, 2021 10:52
Copy link
Member

@jjerphan jjerphan left a 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.py

Co-authored-by: Julien Jerphanion <[email protected]>
@agramfort agramfort changed the title WIP: Deprecates 'normalize' in _omp.py MRG: Deprecates 'normalize' in _omp.py Jun 16, 2021
Copy link
Member

@lorentzenchr lorentzenchr left a comment

Choose a reason for hiding this comment

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

Some minor comments.

@agramfort
Copy link
Member

@lorentzenchr @rth @glemaitre this one should be good to go.

Copy link
Member

@rth rth left a comment

Choose a reason for hiding this comment

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

Thanks @maikia @agramfort !

@lorentzenchr lorentzenchr changed the title MRG: Deprecates 'normalize' in _omp.py DEP deprecates 'normalize' in _omp.py Jun 17, 2021
@lorentzenchr lorentzenchr merged commit dc2b587 into scikit-learn:main Jun 17, 2021
@ogrisel
Copy link
Member

ogrisel commented Jun 17, 2021

Nice! Thanks @maikia, @agramfort and everyone involved in the review!

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.

7 participants