Created
March 15, 2021 09:51
-
-
Save PranjalDureja0002/700f13397186e4846379670f6863f721 to your computer and use it in GitHub Desktop.
model
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
min_max_scaler = preprocessing.MinMaxScaler() | |
def scale_fun(X_train,X_test,col): | |
min_max_scaler.fit(X_train[col].values.reshape(-1,1)) | |
X_train_=min_max_scaler.transform(X_train[col].values.reshape(-1,1)) | |
X_test_=min_max_scaler.transform(X_test[col].values.reshape(-1,1)) | |
return X_train_,X_test_ | |
for col in X_train.columns: | |
X_train_,X_test_= scale_fun(X_train,X_test,col) | |
X_train[col] = X_train_ | |
X_test[col] = X_test_ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment