Created
July 18, 2020 07:07
-
-
Save ranpelta/c3a0fa6d4addd23c7caa48a971a7e6f8 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
Xscaler = MinMaxScaler(feature_range=(0, 1)) # scale so that all the X data will range from 0 to 1 | |
Xscaler.fit(X_train) | |
scaled_X_train = Xscaler.transform(X_train) | |
print(X_train.shape) | |
Yscaler = MinMaxScaler(feature_range=(0, 1)) | |
Yscaler.fit(y_train) | |
scaled_y_train = Yscaler.transform(y_train) | |
print(scaled_y_train.shape) | |
scaled_y_train = scaled_y_train.reshape(-1) # remove the second dimention from y so the shape changes from (n,1) to (n,) | |
print(scaled_y_train.shape) | |
scaled_y_train = np.insert(scaled_y_train, 0, 0) | |
scaled_y_train = np.delete(scaled_y_train, -1) | |
>>>(28916, 3) | |
>>>(28916, 1) | |
>>>(28916,) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment