Python中的主成分分析 [英] Principal component analysis in Python
问题描述
我想使用主成分分析(PCA)来降低尺寸. numpy或scipy是否已经拥有它,或者我必须使用 numpy.linalg.eigh
?
I'd like to use principal component analysis (PCA) for dimensionality reduction. Does numpy or scipy already have it, or do I have to roll my own using numpy.linalg.eigh
?
我不只是想使用奇异值分解(SVD),因为我的输入数据具有很高的维数(〜460维),所以我认为SVD比计算协方差矩阵的特征向量要慢.
I don't just want to use singular value decomposition (SVD) because my input data are quite high-dimensional (~460 dimensions), so I think SVD will be slower than computing the eigenvectors of the covariance matrix.
我希望找到一种预制的,经过调试的实现方式,该实现方式已经为何时使用哪种方法以及哪些我不知道的其他优化做出了正确的决定.
I was hoping to find a premade, debugged implementation that already makes the right decisions for when to use which method, and which maybe does other optimizations that I don't know about.
推荐答案
您可以看看 MDP 一个>.
我还没有机会亲自对其进行测试,但是我已将其标记为完全具有PCA功能.
I have not had the chance to test it myself, but I've bookmarked it exactly for the PCA functionality.
这篇关于Python中的主成分分析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!