Created
January 7, 2022 11:47
-
-
Save shepai/4e1ca5c973de958e9fbecc3d0ec58d03 to your computer and use it in GitHub Desktop.
Standardized data
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
| """ | |
| Normalize datasets | |
| """ | |
| #perform preprocessing scaling of the data | |
| toTrain=train_X.reshape(len(train_X),28*28) | |
| toTest=test_X.reshape(len(test_X),28*28) | |
| scaler1 = preprocessing.StandardScaler().fit(toTrain) | |
| X_standard_train = scaler1.transform(toTrain) | |
| scaler2 = preprocessing.StandardScaler().fit(toTest) | |
| X_standard_test = scaler2.transform(toTest) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment