Skip to content

Instantly share code, notes, and snippets.

@rdisipio
Created November 5, 2022 14:22
Show Gist options
  • Save rdisipio/f7b80136b6354e2e2ee43888ea69c1b0 to your computer and use it in GitHub Desktop.
Save rdisipio/f7b80136b6354e2e2ee43888ea69c1b0 to your computer and use it in GitHub Desktop.
from sklearn.decomposition import PCA
pca = PCA(n_components=5)
X_pca = pca.fit_transform(X)
print("Relative importance (fraction of unity):")
print(pca.explained_variance_ratio_)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment