10000 DOC Clarifies docstrings in decomposition (#19161) · scikit-learn/scikit-learn@d6435b7 · GitHub
[go: up one dir, main page]

Skip to content

Commit d6435b7

Browse files
authored
DOC Clarifies docstrings in decomposition (#19161)
1 parent ea5342c commit d6435b7

File tree

4 files changed

+22
-22
lines changed

4 files changed

+22
-22
lines changed

sklearn/decomposition/_dict_learning.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,10 +1156,10 @@ class DictionaryLearning(_BaseSparseCoding, BaseEstimator):
11561156
11571157
fit_algorithm : {'lars', 'cd'}, default='lars'
11581158
* `'lars'`: uses the least angle regression method to solve the lasso
1159-
problem (`linear_model.lars_path`);
1159+
problem (:func:`~sklearn.linear_model.lars_path`);
11601160
* `'cd'`: uses the coordinate descent method to compute the
1161-
Lasso solution (`linear_model.Lasso`). Lars will be faster if
1162-
the estimated components are sparse.
1161+
Lasso solution (:class:`~sklearn.linear_model.Lasso`). Lars will be
1162+
faster if the estimated components are sparse.
11631163
11641164
.. versionadded:: 0.17
11651165
*cd* coordinate descent method to improve speed.
@@ -1169,11 +1169,11 @@ class DictionaryLearning(_BaseSparseCoding, BaseEstimator):
11691169
Algorithm used to transform the data:
11701170
11711171
- `'lars'`: uses the least angle regression method
1172-
(`linear_model.lars_path`);
1172+
(:func:`~sklearn.linear_model.lars_path`);
11731173
- `'lasso_lars'`: uses Lars to compute the Lasso solution.
11741174
- `'lasso_cd'`: uses the coordinate descent method to compute the
1175-
Lasso solution (`linear_model.Lasso`). `'lasso_lars'` will be faster
1176-
if the estimated components are sparse.
1175+
Lasso solution (:class:`~sklearn.linear_model.Lasso`). `'lasso_lars'`
1176+
will be faster if the estimated components are sparse.
11771177
- `'omp'`: uses orthogonal matching pursuit to estimate the sparse
11781178
solution.
11791179
- `'threshold'`: squashes to zero all coefficients less than alpha from
@@ -1404,7 +1404,7 @@ class MiniBatchDictionaryLearning(_BaseSparseCoding, BaseEstimator):
14041404
shuffle : bool, default=True
14051405
Whether to shuffle the samples before forming batches.
14061406
1407-
dict_init : nbarray of shape (n_components, n_features), default=None
1407+
dict_init : ndarray of shape (n_components, n_features), default=None
14081408
initial value of the dictionary for warm restart scenarios
14091409
14101410
transform_algorithm : {'lasso_lars', 'lasso_cd', 'lars', 'omp', \

sklearn/decomposition/_lda.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ class LatentDirichletAllocation(TransformerMixin, BaseEstimator):
194194
Number of documents to use in each EM iteration. Only used in online
195195
learning.
196196
197-
evaluate_every : int, default=0
197+
evaluate_every : int, default=-1
198198
How often to evaluate perplexity. Only used in `fit` method.
199199
set it to 0 or negative number to not evaluate perplexity in
200200
training at all. Evaluating perplexity can help you check convergence

sklearn/decomposition/_nmf.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,23 +1138,23 @@ class NMF(TransformerMixin, BaseEstimator):
11381138
Default: None.
11391139
Valid options:
11401140
1141-
- None: 'nndsvd' if n_components <= min(n_samples, n_features),
1142-
otherwise random.
1141+
- `None`: 'nndsvd' if n_components <= min(n_samples, n_features),
1142+
otherwise random.
11431143
1144-
- 'random': non-negative random matrices, scaled with:
1145-
sqrt(X.mean() / n_components)
1144+
- `'random'`: non-negative random matrices, scaled with:
1145+
sqrt(X.mean() / n_components)
11461146
1147-
- 'nndsvd': Nonnegative Double Singular Value Decomposition (NNDSVD)
1148-
initialization (better for sparseness)
1147+
- `'nndsvd'`: Nonnegative Double Singular Value Decomposition (NNDSVD)
1148+
initialization (better for sparseness)
11491149
1150-
- 'nndsvda': NNDSVD with zeros filled with the average of X
1151-
(better when sparsity is not desired)
1150+
- `'nndsvda'`: NNDSVD with zeros filled with the average of X
1151+
(better when sparsity is not desired)
11521152
1153-
- 'nndsvdar': NNDSVD with zeros filled with small random values
1154-
(generally faster, less accurate alternative to NNDSVDa
1155-
for when sparsity is not desired)
1153+
- `'nndsvdar'` NNDSVD with zeros filled with small random values
1154+
(generally faster, less accurate alternative to NNDSVDa
1155+
for when sparsity is not desired)
11561156
1157-
- 'custom': use custom matrices W and H
1157< CAE3 code class="diff-text syntax-highlighted-line addition">+
- `'custom'`: use custom matrices W and H
11581158
11591159
solver : {'cd', 'mu'}, default='cd'
11601160
Numerical solver to use:
@@ -1207,7 +1207,7 @@ class NMF(TransformerMixin, BaseEstimator):
12071207
Regularization parameter *l1_ratio* used in the Coordinate Descent
12081208
solver.
12091209
1210-
verbose : bool, default=False
1210+
verbose : int, default=0
12111211
Whether to be verbose.
12121212
12131213
shuffle : bool, default=False

sklearn/decomposition/_pca.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ class PCA(_BasePCA):
130130
131131
Parameters
132132
----------
133-
n_components : int, float or str, default=None
133+
n_components : int, float or 'mle', default=None
134134
Number of components to keep.
135135
if n_components is not set all components are kept::
136136

0 commit comments

Comments
 (0)
0