Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 07ad06e

Browse filesBrowse files
jeremiedbbglemaitre
authored andcommitted
[DOC] Clarify the docstring of dict learning about the inits (#19227)
1 parent 54571bf commit 07ad06e
Copy full SHA for 07ad06e

File tree

Expand file treeCollapse file tree

2 files changed

+12
-6
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+12
-6
lines changed

‎sklearn/decomposition/_dict_learning.py

Copy file name to clipboardExpand all lines: sklearn/decomposition/_dict_learning.py
+8-4Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -487,10 +487,12 @@ def dict_learning(X, n_components, *, alpha, max_iter=100, tol=1e-8,
487487
for more details.
488488
489489
dict_init : ndarray of shape (n_components, n_features), default=None
490-
Initial value for the dictionary for warm restart scenarios.
490+
Initial value for the dictionary for warm restart scenarios. Only used
491+
if `code_init` and `dict_init` are not None.
491492
492493
code_init : ndarray of shape (n_samples, n_components), default=None
493-
Initial value for the sparse code for warm restart scenarios.
494+
Initial value for the sparse code for warm restart scenarios. Only used
495+
if `code_init` and `dict_init` are not None.
494496
495497
callback : callable, default=None
496498
Callable that gets invoked every five iterations
@@ -1205,10 +1207,12 @@ class DictionaryLearning(_BaseSparseCoding, BaseEstimator):
12051207
for more details.
12061208
12071209
code_init : ndarray of shape (n_samples, n_components), default=None
1208-
Initial value for the code, for warm restart.
1210+
Initial value for the code, for warm restart. Only used if `code_init`
1211+
and `dict_init` are not None.
12091212
12101213
dict_init : ndarray of shape (n_components, n_features), default=None
1211-
Initial values for the dictionary, for warm restart.
1214+
Initial values for the dictionary, for warm restart. Only used if
1215+
`code_init` and `dict_init` are not None.
12121216
12131217
verbose : bool, default=False
12141218
To control the verbosity of the procedure.

‎sklearn/decomposition/_sparse_pca.py

Copy file name to clipboardExpand all lines: sklearn/decomposition/_sparse_pca.py
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,12 @@ class SparsePCA(TransformerMixin, BaseEstimator):
5454
for more details.
5555
5656
U_init : ndarray of shape (n_samples, n_components), default=None
57-
Initial values for the loadings for warm restart scenarios.
57+
Initial values for the loadings for warm restart scenarios. Only used
58+
if `U_init` and `V_init` are not None.
5859
5960
V_init : ndarray of shape (n_components, n_features), default=None
60-
Initial values for the components for warm restart scenarios.
61+
Initial values for the components for warm restart scenarios. Only used
62+
if `U_init` and `V_init` are not None.
6163
6264
verbose : int or bool, default=False
6365
Controls the verbosity; the higher, the more messages. Defaults to 0.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.