Created
July 13, 2020 18:28
-
-
Save dvgodoy/268359171a95daba4cd496743dd08200 to your computer and use it in GitHub Desktop.
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 sklearn.preprocessing import StandardScaler | |
| scaler = StandardScaler(with_mean=True, with_std=True) | |
| # We use the TRAIN set ONLY to fit the scaler | |
| scaler.fit(x_train) | |
| # Now we can use the already fit scaler to TRANSFORM | |
| # both TRAIN and VALIDATION sets | |
| scaled_x_train = scaler.transform(x_train) | |
| scaled_x_val = scaler.transform(x_val) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment