I'm performing a PCA using the sklearn.decomposition.pca function.

It appears to work as it should. Acording to this question, I can get the eigenvalues like this:.

The eigenvalues represent the variance in the direction of the eigenvector. So you can get them through the pca.explained_variance_ attribute:

eigenvalues = pca.explained_variance_

If this is correct, the eigenvalues for my first few components seem to be way to high.

eigenvalues = pca.explained_variance_
eigenvalues # returns  [1188.482427    760.26572144  581.29434167  325.56710676  267.10095401
  219.49301802  155.1603308   107.8855256    76.17770897   64.09568959]

For every scree-plot I've seen and for example, when you google screeplot on google, the eigenvalues are usually much, much lower. Can eigenvalues be this high?


sklearn doesn't scale your data:

The input data is centered but not scaled for each feature before applying the SVD.

Your variances are high because your feature variances are high. In general, standardization is recommended because otherwise some of your features with low values won't be represented well.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.