-
-
Notifications
You must be signed in to change notification settings - Fork 26.2k
Closed
Description
Description
The singular_values_
attribute of PCA
is broken.
Steps/Code to Reproduce
The docstring for PCA
contains the following example:
import numpy as np
from sklearn.decomposition import PCA
X = np.array([[-1, -1], [-2, -1], [-3, -2], [1, 1], [2, 1], [3, 2]])
pca = PCA(n_components=2)
pca.fit(X)
print(pca.singular_values_)
Expected Results
From the docstring:
[ 6.30061... 0.54980...]
Actual Results
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-340-afb570ab70cc> in <module>()
4 pca = PCA(n_components=2)
5 pca.fit(X)
----> 6 print(pca.singular_values_)
AttributeError: 'PCA' object has no attribute 'singular_values_'
Versions
Darwin-16.7.0-x86_64-i386-64bit
Python 3.6.1 |Anaconda 4.4.0 (x86_64)| (default, May 11 2017, 13:04:09)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]
NumPy 1.13.0
SciPy 0.19.1
Scikit-Learn 0.18.1
Metadata
Metadata
Assignees
Labels
No labels