Last active
October 2, 2019 12:13
-
-
Save L-Lewis/8bdc3858208d6629b7082883eb101db7 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 MinMaxScaler | |
def process_structured_data(df, train, test): | |
""" | |
Pre-processes the given dataframe by minmaxscaling the continuous features | |
(fit-transforming the training data and transforming the test data) | |
""" | |
continuous = ["population_per_hectare", "bicycle_aadf", "motor_vehicle_aadf"] | |
cs = MinMaxScaler() | |
trainX = cs.fit_transform(train[continuous]) | |
testX = cs.transform(test[continuous]) | |
return (trainX, testX) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment