-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
ENH: Add regularization to the main NMF class #17414
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
Conversation
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 for the PR @Bharat123rox
Update `_nmf.py` with suggestion from review Co-authored-by: Adrin Jalali <adrin.jalali@gmail.com>
Doc failures seem to be intermittent, or a build failure from CircleCI which are unrelated to these changes 😞 |
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.
Thank you for the PR @Bharat123rox !
@Bharat123rox something went wrong in CircleCI, unrelated with your PR: do you mind fixing conflicts in order to trigger the build? 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.
Thanks @Bharat123rox!
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.
Nice job !
You might want to add a changelog entry in doc/whats_new/0.24.rst
.
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
@@ -1081,7 +1081,7 @@ def non_negative_factorization(X, W=None, H=None, n_components=None, *, | |||
|
|||
|
|||
class NMF(TransformerMixin, BaseEstimator): | |||
r"""Non-Negative Matrix Factorization (NMF) | |||
"""Non-Negative Matrix Factorization (NMF) |
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.
This was to make
regularization : {'both', 'components', 'transformation', None}, \
default='both'
work with the \
. I do not think there is a way to ignore the newline in a raw string.
XREF: numpy/numpydoc#87
Thanks @Bharat123rox ! |
* ENH: Add regularization to the main NMF class * Update _nmf with suggestions from code review Update `_nmf.py` with suggestion from review Co-authored-by: Adrin Jalali <adrin.jalali@gmail.com> * Refactor tests, fix linter errors * Change default value to None * Revert back to default value of "both" * Update default value documentation acc to @thomasjpfan Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com> * CLN Places regularization at the end * Add whatsnew entry * DOC Fix * DOC Fix Co-authored-by: Adrin Jalali <adrin.jalali@gmail.com> Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
Reference Issues/PRs
Fixes #12520
What does this implement/fix? Explain your changes.
Introduces the
regularization
parameter to the mainNMF()
class instead of just the publicnon_negative_factorization
public functionAny other comments?
Need guidance on how to add tests to the
test_nmf_regularization()
Tagging @adrinjalali for PR review, based on the issue