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

Skip to content

Conversation

@rflamary
Copy link
Contributor

@rflamary rflamary commented Dec 9, 2024

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.py

The tests have also been updated to check that the reconstruction is accurate.

Any other comments?

@rflamary rflamary changed the title Implement inverse_transform in DictionaryLearningand SparseCoder ENH Implement inverse_transform in DictionaryLearningand SparseCoder Dec 9, 2024
@github-actions
Copy link

github-actions bot commented Dec 9, 2024

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: f36eeee. Link to the linter CI: here

@rflamary rflamary changed the title ENH Implement inverse_transform in DictionaryLearningand SparseCoder ENH Implement inverse_transform in DictionaryLearning, SparseCoder and MiniBatchDictionaryLearning Dec 10, 2024
@rflamary rflamary requested a review from agramfort December 10, 2024 09:26
Copy link
Member

@jeremiedbb jeremiedbb left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @rflamary.

rflamary and others added 4 commits December 12, 2024 15:36
Co-authored-by: Jérémie du Boisberranger <[email protected]>
Co-authored-by: Jérémie du Boisberranger <[email protected]>
Co-authored-by: Jérémie du Boisberranger <[email protected]>
Co-authored-by: Jérémie du Boisberranger <[email protected]>
Copy link
Member

@jeremiedbb jeremiedbb left a comment

Choose a reason for hiding this comment

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

Looks good thanks. One last thing we need is a dedicated test checking the error message when we pass a code with wrong shape.

EDIT: sorry just saw that it's there already :)

Copy link
Member

@jeremiedbb jeremiedbb left a comment

Choose a reason for hiding this comment

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

LGTM.

@rflamary
Copy link
Contributor Author

OK I added the match in the pytest.raises. I guess the PR is OK?

@jeremiedbb jeremiedbb added the Waiting for Second Reviewer First reviewer is done, need a second one! label Dec 13, 2024
Copy link
Member

@agramfort agramfort left a comment

Choose a reason for hiding this comment

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

thx @rflamary !

@agramfort agramfort merged commit 4ad187a into scikit-learn:main Dec 19, 2024
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module:decomposition Waiting for Second Reviewer First reviewer is done, need a second one!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing inverse_transform in DictionaryLearningand SparseCoder

3 participants