[scikit-learn] function transformer

Manprit Singh manpritsinghece at gmail.com
Fri Jun 18 06:45:10 EDT 2021


Dear sir ,

Just need to know if I can use a function transformer to generate new
columns in the data set .

Just see the below written pipeline

num_pipeline = Pipeline([('imputer', SimpleImputer(strategy="median")),
                         ('attribs_adder', column_adder),
                         ('std_scaler', StandardScaler()),
                        ])
This pipeline is for numerical attributes in the dataset, firstly it will
treat all mising values in the data set using  SimpleImputer , then i have
made a function to add three more columns in the existing data, i have made
a function transformer with this function and then StandardScaler .

The columns being added are generated from existing columns (by element
wise division of two columns) . So Using a function transformer is ok ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/scikit-learn/attachments/20210618/492988aa/attachment.html>


More information about the scikit-learn mailing list