Created
November 29, 2012 23:14
-
-
Save vals/4172579 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
loadings = pca.components_ | |
# I've omitted the code to create ind; a list of the indexes of the | |
# loadings ordered by distance from origin. | |
plt.scatter(*loadings, alpha=0.3, label="Loadings"); | |
plt.scatter(*loadings[:, ind[:3]], c='r', marker='o', | |
s=80, linewidths=1, facecolors="none", | |
edgecolors='r', | |
label="Contributes most\nto variance"); | |
plt.title("Loading plot"); | |
plt.xlabel("Loadings on PC1"); | |
plt.ylabel("Loadings on PC2"); | |
plt.grid(); | |
plt.legend(loc='lower left'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment