<p dir="auto">When passing <code class="notranslate">whiten=True</code> to <code class="notranslate">PCA()</code>, component-wise variances are not 'unit' as is claimed.</p>
<p dir="auto">Unless I'm missing something, this is a regression presumably caused by <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="235038568" data-permission-text="Title is private" data-url="https://github.com/scikit-learn/scikit-learn/issues/9105" data-hovercard-type="pull_request" data-hovercard-url="/scikit-learn/scikit-learn/pull/9105/hovercard" href="https://github.com/scikit-learn/scikit-learn/pull/9105">#9105</a> (which appeared in v0.19)?</p>
<p dir="auto">Example:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="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))"><pre class="notranslate"><span class="pl-k">from</span> <span class="pl-s1">sklearn</span>.<span class="pl-s1">datasets</span> <span class="pl-k">import</span> <span class="pl-s1">make_classification</span>
<span class="pl-k">from</span> <span class="pl-s1">sklearn</span>.<span class="pl-s1">decomposition</span> <span class="pl-k">import</span> <span class="pl-v">PCA</span>

<span class="pl-v">X</span>, <span class="pl-s1">_</span> <span class="pl-c1">=</span> <span class="pl-en">make_classification</span>(<span class="pl-s1">n_samples</span><span class="pl-c1">=</span><span class="pl-c1">1000</span>, <span class="pl-s1">n_features</span><span class="pl-c1">=</span><span class="pl-c1">4</span>, <span class="pl-s1">n_informative</span><span class="pl-c1">=</span><span class="pl-c1">3</span>, <span class="pl-s1">n_redundant</span><span class="pl-c1">=</span><span class="pl-c1">0</span>,
                           <span class="pl-s1">n_repeated</span><span class="pl-c1">=</span><span class="pl-c1">0</span>, <span class="pl-s1">n_classes</span><span class="pl-c1">=</span><span class="pl-c1">2</span>, <span class="pl-s1">random_state</span><span class="pl-c1">=</span><span class="pl-c1">10</span>, <span class="pl-s1">shift</span><span class="pl-c1">=</span><span class="pl-c1">10.</span>, <span class="pl-s1">scale</span><span class="pl-c1">=</span><span class="pl-c1">10.</span>)
<span class="pl-en">print</span>(<span class="pl-c1">1</span> <span class="pl-c1">-</span> <span class="pl-v">PCA</span>(<span class="pl-s1">whiten</span><span class="pl-c1">=</span><span class="pl-c1">True</span>).<span class="pl-en">fit_transform</span>(<span class="pl-v">X</span>).<span class="pl-en">var</span>(<span class="pl-s1">axis</span><span class="pl-c1">=</span><span class="pl-c1">0</span>))</pre></div>
<p dir="auto">Under <code class="notranslate">v0.18.2</code>, this outputs</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[ -4.44089210e-16   0.00000000e+00   1.11022302e-16   6.66133815e-16]"><pre class="notranslate"><code class="notranslate">[ -4.44089210e-16   0.00000000e+00   1.11022302e-16   6.66133815e-16]
</code></pre></div>
<p dir="auto">Under <code class="notranslate">v0.19.0</code>, this outputs</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[ 0.001  0.001  0.001  0.001]"><pre class="notranslate"><code class="notranslate">[ 0.001  0.001  0.001  0.001]
</code></pre></div>
<p dir="auto">The documentation for sklearn.decomposition.PCA says that<br>
"Implements the probabilistic PCA model from: M. Tipping and C. Bishop, Probabilistic Principal Component Analysis, Journal of the Royal Statistical Society, Series B, 61, Part 3, pp. 611-622 via the score and score_samples methods."</p>
<p dir="auto">It is unclear what the intention is for the other methods, but to match the MLE for PCA some changes need to be made:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="explained_variance_ = (S ** 2) / (n_samples - 1)"><pre class="notranslate"><code class="notranslate">explained_variance_ = (S ** 2) / (n_samples - 1)
</code></pre></div>
<p dir="auto">on Line 423 needs to be</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="explained_variance_ = (S ** 2) / n_samples"><pre class="notranslate"><code class="notranslate">explained_variance_ = (S ** 2) / n_samples
</code></pre></div>
<p dir="auto">Since the former is using the unbiased estimate of covariance and the latter is used in Tipping and Bishop eq (11).</p>
<p dir="auto">Also, the projection of PPCA in Sec 3.3 of Tipping and Bishop is different than the conventional projection used in the implementation here.  That needs to be clarified in the documentation.  Maybe a separate class needs to be made (PPCA) that more cleanly implements Tipping and Bishop.</p>