Created
January 19, 2017 22:56
-
-
Save Wann-Jiun/361aa6702f6c823eaa41a3cf6c95112a 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.preprocessing import StandardScaler | |
scaling = StandardScaler() | |
scaling.fit(train_df[numerical_features]) | |
scaling_result = scaling.transform(train_df[numerical_features]) | |
for i, col in enumerate(numerical_features): | |
train_df[col] = scaling_result[:, i] | |
scaling_result = scaler.transform(test_df_munged[numeric_features]) | |
for i, col in enumerate(numeric_features): | |
test_df[col] = scaling_result[:, i] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment