-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
RFC Make non_negative_factorization call NMF instead of the opposite #19607
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.
I made a first quick pass
Hello everyone I need some help about
from the lines I put here a snippet having the same problem import numpy as np
from sklearn.decomposition import non_negative_factorization
rng = np.random.RandomState(0)
X = rng.random_sample((20, 15))
H = rng.random_sample((15, 15))
W = rng.random_sample((20, 15))
non_negative_factorization(X, H=H, update_H=False) Apparently the scikit-learn/sklearn/utils/validation.py Line 1040 in 4beb0c2
(I have temporarily added a print(attrs) to check). Is that an expected behavior? Thanks!
|
Let's forget the idea of being able to call transform without fit. It makes the code too complicated. That way this PR is completely transparent to the user and doesn't change the API at all. I directly pushed this. |
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 @cmarmo. I just have one last remark
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.
LGTM, just a small suggestion and a question/confirmation:
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.
LGTM. Thanks @cmarmo !
Thanks @cmarmo ! |
Reference Issues/PRs
Working on the MiniBatch implementation of the Non-negative Matrix Factorization class (#16948), it has been suggested that a reformat of both standard NMF and the in progress MiniBatch implementation would improve the maintainability of the code. This pull request applies this reformatting using #14985 and #18975 as models.
What does this implement/fix? Explain your changes.
Make
non_negative_factorization
callNMF
instead of the opposite.Any other comments?
I had to add a tag to the
NMF
class to avoid then_features_in
common test: but I'm not sure this was the right way to make the test pass.ping @TomDLT and @jeremiedbb : thanks!