How I can get the the eigen values and eigen vectors of the PCA application?
from sklearn.decomposition import PCA
clf=PCA(0.98,whiten=True) #converse 98%
You are computing the eigenvectors of the correlation matrix, that is the covariance matrix of the normalized variables.
data/=np.std(data, axis=0)
is not part of the classic PCA, we only center the variables.
So the sklearn PCA does not feature scale the data beforehand.
Apart from that you are on the right track, if we abstract the fact that the code you provided did not run ;).
You only got confused with the row/column layouts. Honestly I think it's much easier to start with X = data.T
and work only with X from there on. I added your code 'fixed' at the end of the post.
You already noted that you can get the eigenvectors using clf.components_
.
So you have the principal components. They are eigenvectors of the covariance matrix