Hi All....!<div>            If i have data set like this means...   </div><div>   <br clear="all"><div><div>3626,5000,2918,5000,2353,2334,2642,1730,1687,1695,1717,1744,593,502,493,504,449,431,444,444,429,10</div><div>438,498,3626,3629,5000,2918,5000,2640,2334,2639,1696,1687,1695,1717,1744,592,502,493,504,449,431,444,441,429,10</div>
<div>439,498,3626,3629,5000,2918,5000,2633,2334,2645,1705,1686,1694,1719,1744,589,502,493,504,446,431,444,444,430,10</div><div>440,5000,3627,3628,5000,2919,3028,2346,2330,2638,1727,1684,1692,1714,1745,588,501,492,504,451,433,446,444,432,10</div>
<div>444,5021,3631,3634,5000,2919,5000,2626,2327,2638,1698,1680,1688,1709,1740,595,500,491,503,453,436,448,444,436,10</div><div>451,5025,3635,3639,5000,2920,3027,2620,2323,2632,1706,1673,1681,1703,753,595,499,491,502,457,440,453,454,442,20</div>
<div>458,5022,3640,3644,5000,2922,5000,2346,2321,2628,1688,1666,1674,1696,744,590,496.</div></div><div><br></div><div>How to do PCA on this data? if it is in array how to do that? and also how to use princomp() in PCA?</div>
<div><br></div><div>Shall i use the following code for doing PCA on given input? could you tell me?</div><div><br></div><div><div>from numpy import mean,cov,double,cumsum,dot,linalg,array,rank</div><div>from pylab import plot,subplot,axis,stem,show,figure</div>
<div>A = array([ [2.4,0.7,2.9,2.2,3.0,2.7,1.6,1.1,1.6,0.9],</div><div>            [2.5,0.5,2.2,1.9,3.1,2.3,2,1,1.5,1.1] ])</div><div>M = (A-mean(A.T,axis=1)).T[latent,coeff] = linalg.eig(cov(M))</div><div>score = dot(coeff.T,M)</div>
<div>return coeff,score,latent</div><div>princomp(A):</div><div>coeff, score, latent = princomp(A.T)</div><div>figure()</div><div>subplot(121)</div><div>m = mean(A,axis=1)</div><div>plot([0, -coeff[0,0]*2]+m[0], [0, -coeff[0,1]*2]+m[1],'--k')</div>
<div>plot([0, coeff[1,0]*2]+m[0], [0, coeff[1,1]*2]+m[1],'--k')</div><div>plot(A[0,:],A[1,:],'ob') # the data</div><div>axis('equal')</div><div>subplot(122)</div><div>plot(score[0,:],score[1,:],'*g')</div>
<div>axis('equal')</div><div>plt.show()</div></div><div><br></div><div>                                                     Thanks....!</div><div>                                                                                  Regards,</div>
<div>                                                                                   Gayathri.</div><br><font color="#009900" face="'comic sans ms', sans-serif"><br><br><br><br><br></font>
</div>