-
-
Notifications
You must be signed in to change notification settings - Fork 25.5k
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
ENH Implement inverse_transform
in DictionaryLearning
, SparseCoder
and MiniBatchDictionaryLearning
#30443
base: main
Are you sure you want to change the base?
Conversation
inverse_transform
in DictionaryLearning
and SparseCoder
inverse_transform
in DictionaryLearning
and SparseCoder
def _inverse_transform(self, code, dictionary): | ||
"""Private method allowing to accommodate both DictionaryLearning and | ||
SparseCoder.""" | ||
if self.split_sign: |
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.
@rflamary can you just see what test needs to be updated to have these lines covered? thanks
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.
It is done (slight modification of the test checking that split_sign
works). Now all tests pass
inverse_transform
in DictionaryLearning
and SparseCoder
inverse_transform
in DictionaryLearning
, SparseCoder
and MiniBatchDictionaryLearning
Reference Issues/PRs
Fixes #30442
Ping to @agramfort
What does this implement/fix? Explain your changes.
This PR implements the methods in the class
_BaseSparseCoding
from https://github.com/scikit-learn/scikit-learn/blob/main/sklearn/decomposition/_dict_learning.pyThe tests have also been updated to check that the reconstruction is accurate.
Any other comments?