-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
get_feature_names handles integer column names #16670
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
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.
I think the conclusion was to raise when input feature names are integers, not silently convert them to strings.
Hi, @adrinjalali thanks for the comment. I have updated the code to reflect the needed changes for the issue. Please have a look. Thanks :) |
I think we should discuss this more widely. So basically we're saying that integer column names are fine as long as we don't want feature names. What would that do once we propagate feature names? |
I'd say as soon as we have to "look" at the feature names, we raise if they're not strings. We could raise in fit w/o feature name propagation if the user passes integer column names, but I'm okay with being "lazy" there ans raising only if they're used. |
I am not sure whether it's merged. I have a suggestion. Do you think we should have a function that raises an error in utils?[or where ever common functions are being stored] For example: |
I think this would be fixed in #17407 |
I disagree and would fight not to have this solution. I don't care that what pandas does is bad. I'm happy to deprecate integer column names once pandas deprecated them [i.e. I veto this change so you can't do it without a core dev vote or convincing me :P ]. |
Closing as |
Fixes #16593
What does this implement/fix? Explain your changes.
OneHotEncoder.get_feature_names
now handlesinteger
column names.