Created
October 4, 2018 05:05
-
-
Save aelnonym/d6c2eecf331375f03f4fe3f21e5f1090 to your computer and use it in GitHub Desktop.
Revisions
-
aelnonym created this gist
Oct 4, 2018 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ from sklearn.preprocessing import StandardScaler from sklearn.decomposition import PCA # Escalando com SciKitLearn---------------------------------------- scaler = StandardScaler() scaler.fit(X) # Fit on training set only. # Apply transform to both the training set and the test set. X = scaler.transform(X) x_test = scaler.transform(x_test) # Aplicando PCA pca = PCA(.95) # Variancia .95 pca.fit(X) X = pca.transform(X) x_test = pca.transform(x_test) # Fim escalamento/ redução de dimensionalidade---------------------