DOC Clarify how initial conditions are chosen for NMF.#17369
Merged
NicolasHug merged 2 commits intoscikit-learn:masterfrom Jun 3, 2020
Merged
DOC Clarify how initial conditions are chosen for NMF.#17369NicolasHug merged 2 commits intoscikit-learn:masterfrom
NicolasHug merged 2 commits intoscikit-learn:masterfrom
Conversation
When update_H is False, any given initial value of W is silently ignored, as are all of the initialization procedures. This commit fixes that by clarifying this in the non_negative_factorization function docstring.
thomasjpfan
reviewed
Jun 1, 2020
Member
thomasjpfan
left a comment
There was a problem hiding this comment.
Thank you for the PR @bsmith89 !
sklearn/decomposition/_nmf.py
Outdated
Comment on lines
+914
to
+917
| - 'custom': use custom matrices W and H | ||
|
|
||
| Ignored if update_H is False, in which case the initial value of W | ||
| is set automatically. |
Member
There was a problem hiding this comment.
This may be clearer:
- 'custom': use custom matrices W and H if `update_H=True`. If `update_H=False`, then
only custom matrix H is used.
The init=='custom' and update_H=False will down the following code path:
scikit-learn/sklearn/decomposition/_nmf.py
Lines 1040 to 1050 in f27adc5
Revised as suggested by @thomasjpfan.
viclafargue
pushed a commit
to viclafargue/scikit-learn
that referenced
this pull request
Jun 26, 2020
jayzed82
pushed a commit
to jayzed82/scikit-learn
that referenced
this pull request
Oct 22, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reference Issues/PRs
None yet. I can submit an issue if that's important.
What does this implement/fix? Explain your changes.
For
sklearn.decomposition.non_negative_factorization, when update_H is False, any given initial value of W is silently ignored, as are all of the initialization procedures.See: sklearn/decomposition/_nmf.py#L1032-L1053
This commit fixes that by clarifying this in the non_negative_factorization function docstring.
Any other comments?
Nope. Simple problem, simple fix.