Skip to content

Instantly share code, notes, and snippets.

@RyotaBannai
Created December 19, 2018 16:51
Show Gist options
  • Save RyotaBannai/0522c9c0673a0c61aef7581f4019b6eb to your computer and use it in GitHub Desktop.
Save RyotaBannai/0522c9c0673a0c61aef7581f4019b6eb to your computer and use it in GitHub Desktop.
pca = PCA().fit(digits.data) # Blank inside the closed bracket
plt.plot(np.cumsum(pca.explained_variance_ratio_),'o-', c='#663399', alpha=.5)
plt.xlabel('Number of components')
plt.ylabel('Cumulative explained variance')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment