Created
February 28, 2020 13:24
-
-
Save JonathanLoscalzo/0877e9ed40a7e36de62e7072f09cdf9e to your computer and use it in GitHub Desktop.
Feature Union example
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
| def preprocess_pipeline(): | |
| return FeatureUnion( | |
| transformer_list = [ | |
| ('date_features', Pipeline([ | |
| ('selector', get_date_data), | |
| ('transform', transform_date_data) | |
| ])), | |
| ('numeric_features', Pipeline([ | |
| ('selector', get_numeric_data), | |
| ('imputer', SimpleImputer()), | |
| ])), | |
| ('text_features', Pipeline([ | |
| ('selector', get_text_data), | |
| ('vectorizer', OrdinalEncoder()) | |
| ])) | |
| ] | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment