Equivalent of ColumnTransformer
functionality remainder{‘drop’, ‘passthrough’}
in feature-engine?
#399
Replies: 2 comments 3 replies
-
Is the idea that each transformer should drop the features that it does not use? or all unused features should be dropped at the end of the pipeline? Could you provide an example of what is the intended functionality / result? |
Beta Was this translation helpful? Give feedback.
-
Thank you for the details @noahjgreen295 I am trying to understand a bit more when we would need the requested functionality. Please help me with the following: If you pass the variables to the different transformers, like in the sklearn pipe or in the feature engine pipe, you do have foreknowledge of which features you will use, in your example x1, x2 and x3. So why not passing dataframe[[x1,x2,x3]] to the pipeline instead of passing the entire dataframe and then dropping the variables at the end? In the case of the feature-engine pipe, in fact, I would recommend passing DropFeatures at the beginning of the pipeline, so all the remaining transformers operate over smaller datasets, then it is more memory efficient. You mention something about difficult in dynamic settings like deployment. I am having trouble trying to understand why you would want to avoid knowing which features to drop, when you would actually know which features to use/keep, and then you could just slice the dataframe to these features from the beginning? Thank you |
Beta Was this translation helpful? Give feedback.
-
Hi,
One of the few things I miss about the
sklearn
feature pipeline is the ability forColumnTransformer
to dynamically drop all variables unused by the transformers it contains, via theremainder='drop'
parameter setting. This allows you to throw arbitraryDataFrame
instances at the pipeline and not have to explicitly drop the unused features, or worry about breaking things if you don't.Is there an equivalent of this functionality in
feature-engine
? If not, could I put together a PR containing a proposed implementation?(Sorry if it's there already and I just couldn't find it)
Thanks,
-Noah
Beta Was this translation helpful? Give feedback.
All reactions