Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 21829b5

Browse files
authored
DOC Mention pandas dataframe support in ColumnTransformer in FAQ (#24532)
1 parent 44860bd commit 21829b5

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

doc/faq.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,17 @@ to support Pandas categorical types. Restricting input to homogeneous
127127
types therefore reduces maintenance cost and encourages usage of efficient
128128
data structures.
129129

130+
Note however that :class:`~sklearn.compose.ColumnTransformer` makes it
131+
convenient to handle heterogeneous pandas dataframes by mapping homogeneous subsets of
132+
dataframe columns selected by name or dtype to dedicated scikit-learn transformers.
133+
134+
Therefore :class:`~sklearn.compose.ColumnTransformer` are often used in the first
135+
step of scikit-learn pipelines when dealing
136+
with heterogeneous dataframes (see :ref:`pipeline` for more details).
137+
138+
See also :ref:`sphx_glr_auto_examples_compose_plot_column_transformer_mixed_types.py`
139+
for an example of working with heterogeneous (e.g. categorical and numeric) data.
140+
130141
Do you plan to implement transform for target y in a pipeline?
131142
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
132143
Currently transform only works for features X in a pipeline.

0 commit comments

Comments
 (0)