Skip to content

[DOC] Clarify the docstring of dict learning about the inits #19227

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

Merged
merged 4 commits into from
Jan 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions sklearn/decomposition/_dict_learning.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,10 +487,12 @@ def dict_learning(X, n_components, *, alpha, max_iter=100, tol=1e-8,
for more details.

dict_init : ndarray of shape (n_components, n_features), default=None
Initial value for the dictionary for warm restart scenarios.
Initial value for the dictionary for warm restart scenarios. Only used
if `code_init` and `dict_init` are not None.

code_init : ndarray of shape (n_samples, n_components), default=None
Initial value for the sparse code for warm restart scenarios.
Initial value for the sparse code for warm restart scenarios. Only used
if `code_init` and `dict_init` are not None.

callback : callable, default=None
Callable that gets invoked every five iterations
Expand Down Expand Up @@ -1205,10 +1207,12 @@ class DictionaryLearning(_BaseSparseCoding, BaseEstimator):
for more details.

code_init : ndarray of shape (n_samples, n_components), default=None
Initial value for the code, for warm restart.
Initial value for the code, for warm restart. Only used if `code_init`
and `dict_init` are not None.

dict_init : ndarray of shape (n_components, n_features), default=None
Initial values for the dictionary, for warm restart.
Initial values for the dictionary, for warm restart. Only used if
`code_init` and `dict_init` are not None.

verbose : bool, default=False
To control the verbosity of the procedure.
Expand Down
6 changes: 4 additions & 2 deletions sklearn/decomposition/_sparse_pca.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,12 @@ class SparsePCA(TransformerMixin, BaseEstimator):
for more details.

U_init : ndarray of shape (n_samples, n_components), default=None
Initial values for the loadings for warm restart scenarios.
Initial values for the loadings for warm restart scenarios. Only used
if `U_init` and `V_init` are not None.

V_init : ndarray of shape (n_components, n_features), default=None
Initial values for the components for warm restart scenarios.
Initial values for the components for warm restart scenarios. Only used
if `U_init` and `V_init` are not None.

verbose : int or bool, default=False
Controls the verbosity; the higher, the more messages. Defaults to 0.
Expand Down