Created
December 26, 2021 16:29
-
-
Save yashprakash13/360b8a14b417cbb567cd385fea390d61 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
# COLUMN PIPELINE | |
from sklearn.impute import SimpleImputer | |
from sklearn.preprocessing import MinMaxScaler | |
from sklearn.pipeline import Pipeline | |
from sklearn.compose import ColumnTransformer | |
› | |
col_transformation_pipeline = Pipeline(steps=[ | |
('impute', SimpleImputer(strategy='mean')), | |
('scale', MinMaxScaler()) | |
]) | |
all_columns = X_train.columns.tolist() | |
columns_transformer = ColumnTransformer(transformers=[ | |
('cols', col_transformation_pipeline, all_columns), | |
]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment