Skip to content

Instantly share code, notes, and snippets.

@Davisy
Created April 26, 2020 15:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Davisy/d4e58b7789c758f88977556010fdff2f to your computer and use it in GitHub Desktop.
Save Davisy/d4e58b7789c758f88977556010fdff2f to your computer and use it in GitHub Desktop.
from sklearn.decomposition import PCA
pca = PCA(random_state=42)
# train
pca.fit(X_train)
# Plots PCA components' explained variance ratios.
skplt.decomposition.plot_pca_component_variance(pca, figsize=(10, 8))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment