擅长:python、mysql、java
<p>分量和逆变换是两个不同的东西。逆变换将组件映射回原始图像空间</p>
<pre><code>#Create a PCA model with two principal components
pca = PCA(2)
pca.fit(data)
#Get the components from transforming the original data.
scores = pca.transform(data)
# Reconstruct from the 2 dimensional scores
reconstruct = pca.inverse_transform(scores )
#The residual is the amount not explained by the first two components
residual=data-reconstruct
</code></pre>
<p>因此,您是对原始数据而不是组件进行反向转换,因此它们完全不同。你几乎从不反变换原始数据。pca.components是表示用于将数据投影到pca空间的基础轴的实际向量。</p>