Skip to content

Instantly share code, notes, and snippets.

@aniruddha27
Created March 27, 2020 20:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aniruddha27/a41a35725ec02006bb3156e5483cb184 to your computer and use it in GitHub Desktop.
Save aniruddha27/a41a35725ec02006bb3156e5483cb184 to your computer and use it in GitHub Desktop.
# data normalization with sklearn
from sklearn.preprocessing import MinMaxScaler
# fit scaler on training data
norm = MinMaxScaler().fit(X_train)
# transform training data
X_train_norm = norm.transform(X_train)
# transform testing dataabs
X_test_norm = norm.transform(X_test)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment