Do not deprecate tuple support for feature names: [FutureWarning: Feature names only support names that are all strings Got feature names with dtypes: ['tuple']. An error will be raised in 1.2.]
See original GitHub issueDescribe the workflow you want to enable
I want to be able to use MutliIndex
Pandas columns for feature names. These are interpreted as tuples.
Describe your proposed solution
To allow tuples and MutliIndex` Pandas columns for features.
Describe alternatives you’ve considered, if relevant
Converting to strings each time I use sklearn but this seems very backwards since tuples can already be used in older versions.
Additional context
I and many others use pd.MultiIndex
objects in our daily workflow. Modeling with sklearn using these dataframes is essential.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
SKLearn warning "valid feature names" in version 1.0
Show activity on this post. It is showing error because our dataframe has feature names but we should fit the data as 2d...
Read more >How to Fix FutureWarning Messages in scikit-learn
This can be achieved by explicitly configuring the Python warning system to ignore warning messages of a specific type, such as ignore all...
Read more >[BUG] dealing with sklearn 1.2 deprecation warnings #2143
Got feature names with dtypes: ['float', 'str']. An error will be raised in 1.2.
Read more >scikit-survival 0.17 released - Sebastian Pölsterl
Starting version 1.2, an error will be raised. Feature names must be in the same order as they were in fit. For more...
Read more >sklearn.base — pyts 0.12.0 documentation - Read the Docs
__class__ new_object_params = estimator.get_params(deep=False) for name, ... default=repr The function to convert entries to strings, typically the builtin ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Looking through the original PR, there was a lot of discussion that concluded with: https://github.com/scikit-learn/scikit-learn/pull/18010#issuecomment-896561811
With that in mind, I think we should adjust the behavior for non-string columns. I think the warning should appear only when the dtype is string + another type. Otherwise, there is no warning and no error in the future. I opened https://github.com/scikit-learn/scikit-learn/pull/22410 to address this issue.
@thomasjpfan thank you very much for looking into this.