-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
[MRG + 1] ENH: allow to pass callable as column specifier in ColumnTransformer #11592
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MRG + 1] ENH: allow to pass callable as column specifier in ColumnTransformer #11592
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
(Travis is passing) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Merging
ohhh yeaahhh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have realised the behaviour here can be problematic. if key(X)
returns a different value at fit and at transform time... This might not be so simple as we thought; it needs to resolve the set of column names/indices at fit time only, no?
It would not be that hard to convert the callable to a set of integer indices at fit time (such a conversion mechanism already exists, for the remainder functionality), main question is how to store cleanly separate from the |
Or not even necessarily "integer indices", we could also simply store what |
Yes, I think so. A PR? |
A partly take-over of #11301 to only add the actual functionality of being able to pass a function (and not the provided
select_dtypes
factory function).