koaning / scikit-lego

Extra blocks for scikit-learn pipelines.
https://koaning.github.io/scikit-lego/
MIT License
1.29k stars 118 forks source link

`get_feature_names_out` for `EstimatorTransformer` #539

Closed CarloLepelaars closed 7 months ago

CarloLepelaars commented 2 years ago

This PR adds get_feature_names_out functionality for EstimatorTransformer. This is a desirable method for EstimatorTransformer because its output is used as input for a subsequent estimator.

@koaning I think it is not necessary to implement get_feature_names_out for the other estimators in sklego.meta, because it seems all these estimators are used as the last component in a Pipeline, except for EstimatorTransformer. EstimatorTransformer will often be a component somewhere in the middle of a Pipeline and therefore get_feature_names_out is desirable. That said I'm happy to work on other implementations of get_feature_names_out in sklego.meta if you disagree with this reasoning.

Solves Issue #533

CarloLepelaars commented 2 years ago

Hey, yes this feature is ready and meant to be reviewed. I'll make sure to add [WIP] if something would be still work in progress

As for the commits there are some commits here that are already merged to scikit-lego from a previous PR, but somehow it still shows when I create a new local branch. Everything up to commit #f06a7af is duplicate. Do you know how we can clean up the commit history?

Otherwise I think we are ready to merge! Fixed the minor nitpicks.

CarloLepelaars commented 2 years ago

@koaning, shall we go ahead and merge this one to main?