[SciPy-user] getting the "best" two eigenvectors for a PCA analysis with a power method

Tiziano Zito t.zito at biologie.hu-berlin.de
Mon Aug 29 02:23:28 CDT 2005


On Fri 26 Aug, 18:46, Syd Diamond wrote:
> I'll be honest -- I'm mostly interested in the end not the means right
> now.  I need to find the first and second principal components of a
> 120x520 matrix.

The package 'MDP' http://mdp-toolkit.sourceforge.net together with
'symeig' http://mdp-toolkit.sourceforge.net/symeig.html offers taht
functionality (and much more). Note that results are much faster 
than standard eigenvalue problem solution with scipy.linalg.eig. 
After installing MDP and symeig you can simply do:

>>> import mdp
>>> out = mdp.pca(input_data, output_dim = 2)




More information about the SciPy-user mailing list