Skip to content

Instantly share code, notes, and snippets.

@finnqiao
Created January 8, 2019 15:55
Show Gist options
  • Save finnqiao/babca62e9f9d835eea4d6274e84e9e51 to your computer and use it in GitHub Desktop.
Save finnqiao/babca62e9f9d835eea4d6274e84e9e51 to your computer and use it in GitHub Desktop.
# Normalizing continuous variables
from sklearn.preprocessing import MinMaxScaler
scaler = MinMaxScaler(feature_range = (0,1))
scaler.fit(X_train)
X_train = scaler.transform(X_train)
X_test = scaler.transform(X_test)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment