Created
November 26, 2019 17:50
-
-
Save gabriel19913/f67ead8df11572878514e3a76c0b1dc1 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
from sklearn.decomposition import PCA | |
pca = PCA(.99, random_state = seed) | |
pca.fit(scaled_X) | |
data = pca.transform(scaled_X) | |
print(f'Percentual de variância explicada por cada componente: {np.round(pca.explained_variance_ratio_*100,3)}') | |
print(f'Percentual total de variância explicada pelas componente: {np.round(pca.explained_variance_ratio_*100,3).sum():.3f}%') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment