取多少个主成分? [英] How many principal components to take?

查看:25
本文介绍了取多少个主成分?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道主成分分析对矩阵进行 SVD,然后生成特征值矩阵.为了选择主成分,我们只需要取前几个特征值.现在,我们如何决定我们应该从特征值矩阵中获取的特征值的数量?

I know that principal component analysis does a SVD on a matrix and then generates an eigen value matrix. To select the principal components we have to take only the first few eigen values. Now, how do we decide on the number of eigen values that we should take from the eigen value matrix?

推荐答案

要决定保留多少特征值/特征向量,您应该首先考虑进行 PCA 的原因.您这样做是为了减少存储需求、减少分类算法的维数,还是出于其他原因?如果您没有任何严格约束,我建议绘制特征值的累积总和(假设它们按降序排列).如果在绘图之前将每个值除以特征值的总和,则您的绘图将显示保留的总方差与特征值数量的比例.然后,该图将很好地指示您何时达到收益递减点(即,通过保留额外的特征值获得的方差很小).

To decide how many eigenvalues/eigenvectors to keep, you should consider your reason for doing PCA in the first place. Are you doing it for reducing storage requirements, to reduce dimensionality for a classification algorithm, or for some other reason? If you don't have any strict constraints, I recommend plotting the cumulative sum of eigenvalues (assuming they are in descending order). If you divide each value by the total sum of eigenvalues prior to plotting, then your plot will show the fraction of total variance retained vs. number of eigenvalues. The plot will then provide a good indication of when you hit the point of diminishing returns (i.e., little variance is gained by retaining additional eigenvalues).

这篇关于取多少个主成分?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆