Created
June 19, 2017 00:39
-
-
Save robert8138/55133f2b94f4429b566b431fa488a1a4 to your computer and use it in GitHub Desktop.
Pipeline 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
transforms = [] | |
transforms.append( | |
('select_binary', ColumnSelector(features=binary)) | |
) | |
transforms.append( | |
('numeric', ExtendedPipeline([ | |
('select', ColumnSelector(features=numeric)), | |
('impute', Imputer(missing_values='NaN', strategy='mean', axis=0)), | |
])) | |
) | |
for field in categorical: | |
transforms.append( | |
(field, ExtendedPipeline([ | |
('select', ColumnSelector(features=[field])), | |
('encode', OrdinalEncoder(min_support=10)) | |
]) | |
) | |
) | |
features = FeatureUnion(transforms) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment