In Python I've calculated the eigenvectors and eigenvalues of my data matrix X
through eig()
. I'm looking to find the top 2 principal components of the data (U = [u1 u2]). I know the top 2 components are the 2 eigenvectors corresponding to the 2 largest eigenvalues, but I'm not sure how to calculate that information with the data at hand (eigenvalues, eigenvectors, and X).
Eigenvectors and eigenvalues calculated:
Eigenvectors = [[-0.68065502 -0.72805308 -0.08153196]
[-0.71680551 0.68482721 -0.13115467]
[-0.15132287 0.03082853 0.98800354]]
Eigenvalues = [2.84217094e-14 2.15257831e+02 8.95193455e+02]