Last active
April 24, 2019 15:53
-
-
Save xiaowei1234/a6b218522920f5c161324cde2fabdce6 to your computer and use it in GitHub Desktop.
Status Code Transformation
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
from sklearn.pipeline import make_pipeline | |
wrap2 = DataFrameMapper([ | |
('Status 1', LookupTransformer({203:1}, 0)) | |
, ('Status 2', LookupTransformer({203:1}, 0)) | |
, ('Status 3', LookupTransformer({203:1}, 0)) | |
]) | |
union = ExpressionTransformer("X[0]+X[1]+X[2]") | |
pl = make_pipeline(wrap2, union) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment