make_column_transformer has different order of arguments than ColumnTransformer
See original GitHub issueI’m not sure if we discussed this or did this on purpose, but I find this very confusing.
ColumnTransformer
has (name, transformer, columns)
and make_columntransformer
has (columns, transformer)
. I guess it’s too late to change this? Though we did say it’s experimental and subject to change.
Issue Analytics
- State:
- Created 5 years ago
- Comments:28 (28 by maintainers)
Top Results From Across the Web
Preserve column order after applying sklearn.compose ...
I'm using Pipeline and ColumnTransformer modules from sklearn library to perform feature engineering on ...
Read more >sklearn.compose.ColumnTransformer
This estimator allows different columns or column subsets of the input to be transformed separately and the features generated by each transformer will...
Read more >How to Use the ColumnTransformer for Data Preparation
How to work through a real dataset with mixed data types and use the ColumnTransformer to apply different transforms to categorical and ...
Read more >Lecture 6: sklearn ColumnTransformer and Text Features
After applying column transformer, the order of the columns in the transformed data has to be the same as the order of the...
Read more >Use ColumnTransformer to apply different preprocessing to ...
Use ColumnTransformer to apply different preprocessing to different columns:- select from DataFrame columns by name- passthrough or drop ...
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
For historical clarity: based on discussion in the PR https://github.com/scikit-learn/scikit-learn/pull/12396, we decided in the end to do it the other way around as decided on above (so
transformer, columns
). The reason is mainly due to technical and user-facing complexity to properly deprecate the current order in master forColumnTransfomer
, while it will be much easier to limit the change to the factory functionmake_column_transformer
, but see the linked PR for more details.One small argument in favour of 2 is that “ColumnTransformer” is a mnemonic for
(column, transformer)
.