Created
December 29, 2020 03:55
-
-
Save e-alizadeh/30b94a5e0e265cd1d431f614e660a391 to your computer and use it in GitHub Desktop.
Plot a PCA correlation circle
This file contains hidden or 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
from mlxtend.plotting import plot_pca_correlation_graph | |
from sklearn.preprocessing import StandardScaler | |
X_norm = StandardScaler().fit_transform(X) # Normalizing the feature columns is recommended (X - mean) / std | |
fig, correlation_matrix = plot_pca_correlation_graph( | |
X_norm, | |
attribute_names, | |
dimensions=(1, 2), | |
figure_axis_size=6 | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment