question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

make_column_transformer has different order of arguments than ColumnTransformer

See original GitHub issue

I’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:closed
  • Created 5 years ago
  • Comments:28 (28 by maintainers)

github_iconTop GitHub Comments

1reaction
jorisvandenbosschecommented, Nov 20, 2018

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 for ColumnTransfomer, while it will be much easier to limit the change to the factory function make_column_transformer, but see the linked PR for more details.

1reaction
jnothmancommented, Oct 17, 2018

One small argument in favour of 2 is that “ColumnTransformer” is a mnemonic for (column, transformer).

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found