Created
March 11, 2021 00:28
-
-
Save zero731/fdd87ca871da4607a86747726443d364 to your computer and use it in GitHub Desktop.
fit preprocessing pipeline for example churn analysis
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
## Preprocess training and test data | |
X_train_tf = preprocessing.fit_transform(X_train) | |
X_test_tf = preprocessing.transform(X_test) | |
## Get the feature names in the order they appear in preprocessed data | |
feature_names = preprocessing.named_transformers_['cat'].named_steps['encoder'].get_feature_names(cat_col) | |
feature_names = np.r_[feature_names, num_cols, rem_cols] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment