Skip to content

Commit 558cf06

Browse files
committed
DOC fix RandomizedPCA docstring for n_components=None
1 parent bba4225 commit 558cf06

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

doc/whats_new.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@ Changelog
111111
:ref:`example_applications_plot_out_of_core_classification.py`.
112112
By `Eustache Diemert`_.
113113

114+
- The default number of components for
115+
:class:`sklearn.decomposition.RandomizedPCA` is now correctly documented
116+
to be ``n_features``. This was the default behavior, so programs using it
117+
will continue to work as they did.
118+
114119
API changes summary
115120
-------------------
116121

sklearn/decomposition/pca.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -375,14 +375,15 @@ class RandomizedPCA(BaseEstimator, TransformerMixin):
375375
376376
Parameters
377377
----------
378-
n_components : int
379-
Maximum number of components to keep: default is 50.
378+
n_components : int, optional
379+
Maximum number of components to keep. When not given or None, this
380+
is set to n_features (the second dimension of the training data).
380381
381382
copy : bool
382383
If False, data passed to fit are overwritten
383384
384385
iterated_power : int, optional
385-
Number of iteration for the power method. 3 by default.
386+
Number of iterations for the power method. 3 by default.
386387
387388
whiten : bool, optional
388389
When True (False by default) the `components_` vectors are divided

0 commit comments

Comments
 (0)