8000 FIX passthrough "remainder" param in make_column_transformer · scikit-learn/scikit-learn@258a795 · GitHub
[go: up one dir, main page]

Skip to content

Commit 258a795

Browse files
committed
FIX passthrough "remainder" param in make_column_transformer
1 parent d929fb3 commit 258a795

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

sklearn/compose/_column_transformer.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,15 @@ def make_column_transformer(*transformers, **kwargs):
595595
----------
596596
*transformers : tuples of column selections and transformers
597597
598+
remainder : {'passthrough', 'drop'}, default 'passthrough'
599+
By default, all remaining columns that were not specified in
600+
`transformers` will be automatically passed through (default of
601+
``'passthrough'``). This subset of columns is concatenated with the
602+
output of the transformers.
603+
By using ``remainder='drop'``, only the specified columns in
604+
`transformers` are transformed and combined in the output, and the
605+
non-specified columns are dropped.
606+
598607
n_jobs : int, optional
599608
Number of jobs to run in parallel (default 1).
600609
@@ -627,8 +636,10 @@ def make_column_transformer(*transformers, **kwargs):
627636
628637
"""
629638
n_jobs = kwargs.pop('n_jobs', 1)
639+
remainder = kwargs.pop('remainder', 'passthrough')
630640
if kwargs:
631641
raise TypeError('Unknown keyword arguments: "{}"'
632642
.format(list(kwargs.keys())[0]))
633643
transformer_list = _get_transformer_list(transformers)
634-
return ColumnTransformer(transformer_list, n_jobs=n_jobs)
644+
return ColumnTransformer(transformer_list, n_jobs=n_jobs,
645+
remainder=remainder)

0 commit comments

Comments
 (0)
0