Skip to content

BUG fix SparseCoder to follow scikit-learn API#16346

Closed
glemaitre wants to merge 11 commits intoscikit-learn:masterfrom
glemaitre:is/16336
Closed

BUG fix SparseCoder to follow scikit-learn API#16346
glemaitre wants to merge 11 commits intoscikit-learn:masterfrom
glemaitre:is/16336

Conversation

@glemaitre
Copy link
Copy Markdown
Member

@glemaitre glemaitre commented Jan 31, 2020

closes #16336

Refactor SparseCoder, DictionaryLearning, MiniBatchDictionaryLearning such that we follow properly our API.

There is a bit of boilerplate but I am not sure how to do better.

Copy link
Copy Markdown
Member

@ogrisel ogrisel left a comment

Choose a reason for hiding this comment

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

First batch of reviews:

Copy link
Copy Markdown
Member

@thomasjpfan thomasjpfan left a comment

Choose a reason for hiding this comment

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

LGTM

@NicolasHug
Copy link
Copy Markdown
Member

For SparseCoder, instead of removing the component_ attribute, would it be possible instead to set it in fit(), and raise a FutureWarning if it is accessed before the estimator is fitted?

@glemaitre
Copy link
Copy Markdown
Member Author

SparseCoder does not require a call to fit indeed. This is a stateless estimator because we pass directly the dictionary. Requiring or forcing calling fit would be breaking backwards compatibility.

@ogrisel
Copy link
Copy Markdown
Member

ogrisel commented Jun 25, 2020

Superseded by #17679.

@ogrisel ogrisel closed this Jun 25, 2020
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.

SparseCoder does not follow the scikit-learn API and will break in 0.24

5 participants