8000 PCA(whiten=True): unit variances != 1 (regression in 0.19) · Issue #11001 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content
PCA(whiten=True): unit variances != 1 (regression in 0.19) #11001
Closed
@aldanor

Description

@aldanor

When passing whiten=True to PCA(), component-wise variances are not 'unit' as is claimed.

Unless I'm missing something, this is a regression presumably caused by #9105 (which appeared in v0.19)?

Example:

from sklearn.datasets import make_classification
from sklearn.decomposition import PCA

X, _ = make_classification(n_samples=1000, n_features=4, n_informative=3, n_redundant=0,
                           n_repeated=0, n_classes=2, random_state=10, shift=10., scale=10.)
print(1 - PCA(whiten=True).fit_transform(X).var(axis=0))

Under v0.18.2, this outputs

[ -4.44089210e-16   0.00000000e+00   1.11022302e-16   6.66133815e-16]

Under v0.19.0, this outputs

[ 0.001  0.001  0.001  0.001]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0