简体   繁体   English

PCA:对于不同数量的组件,相同的解释方差比

[英]PCA : same explained variance ratio for different number of components

I'm trying to understand PCA. 我试图了解PCA。 I have a 3-dimensional dataset, I built two PCA models, one with 2 components, and the other with 3 components. 我有一个三维数据集,我建立了两个PCA模型,一个包含2个组件,另一个包含3个组件。 However, I don't understand why the explained variances ratio for both PCA models is the same. 但是,我不明白为什么两个PCA模型的解释方差比率都相同。

Model with 2 components: [ 0.60792494  0.31234679]
Model with 3 components: [ 0.60792494  0.31234679  0.07972828]

If the data you are using is the same for both models, then were you to use all possible components, the explained variance ratio should sum to 1. In your instance, the first two components explain ~91% of the variation. 如果两个模型使用的数据都相同,那么如果使用所有可能的成分,则说明的方差比应为1。在您的实例中,前两个成分可解释〜91%的变化。 Because each PCA component is orthogonal to the previous ones, any additional components you add will explain only the variance that has not yet been explained. 由于每个PCA组件都与先前的组件正交,因此添加的任何其他组件将仅说明尚未说明的差异。 Thus, the first 2 components of the 3 component model will explain the same amount as the 2 component model and the 3rd component will explain an additional 8% of variation. 因此,3分量模型的前2个分量将解释与2分量模型相同的数量,第3分量将解释另外8%的变化。

You're using python, perhaps a good intuitive introduction and examples could be found in http://scikit-learn.org/stable/modules/generated/sklearn.decomposition.PCA.html 您使用的是python,也许可以在http://scikit-learn.org/stable/modules/generation/sklearn.decomposition.PCA.html中找到一个很好的直观介绍和示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM