Last active
July 23, 2020 17:03
-
-
Save vanbrands/b6aaa9c58a9b2ee1450d1374831c1a01 to your computer and use it in GitHub Desktop.
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.compose import ColumnTransformer | |
# Define you transformers. | |
preprocessing = ColumnTransformer(transformers=[ | |
('encode_categorical_features', OneHotEncoder(), ['categorical_column']) | |
], remainder='passthrough') | |
estimator = GradientBoostingClassifier() | |
# Define steps in the pipeline. | |
pipeline = Pipeline(steps=[ | |
('preprocessing', preprocessing), | |
('model', estimator) | |
]) | |
pipeline.fit(x_train, y_train) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment