Created
March 2, 2021 14:54
-
-
Save PranjalDureja0002/c44573b883dd47da74ac9e377c3774d8 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