ColumnTransformer
ColumnTransformer is a scikit-learn transformer that applies different transformations to specified subsets of input features and combines their outputs.
Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI
ColumnTransformer is a scikit-learn class that applies different transformations to specified subsets of input features and combines their outputs.
- How it is used
- Prepares mixed tabular features for estimators by routing column subsets through separate transformations inside pipelines.
- How deep it goes
- Defines branch tuples, column selection, output options, and pipeline use without descending into implementation internals.
- Examples
- Uses Airbnb listings to one-hot encode categories, process continuous fields, train linear and tree models, and assemble XGBoost features.
- What you can do after
- Apply it via scikit-learn to build reproducible preprocessing-and-model pipelines for mixed tabular data.
Ensemble Methods for Machine Learning
ColumnTransformer is a scikit-learn transformer that applies different transformations to specified subsets of input columns and combines their outputs.
- How it is used
- Coordinates heterogeneous feature preprocessing before model training and evaluation.
- How deep it goes
- Explains column routing, nested pipelines, fitting, transformation, passthrough, and leakage prevention, but not internal implementation.
- Examples
- Demonstrates mixed preprocessing on Australian Credit Approval and Adult income datasets, including feature expansion and classification evaluation.
- What you can do after
- Operate/configure a ColumnTransformer that preprocesses training and test subsets consistently before classification.
Read how Ensemble Methods for Machine Learning explains ColumnTransformer →
Related concepts
- pipelinepart of · A pipeline is an ordered or coordinated sequence of connected processing stages or tasks that passes data, work, or results toward an outcome.
- one-hot encodinguses · One-hot encoding represents each category as a binary vector or set of indicators with exactly one active component identifying that category.
- standardizationuses · Standardization is the transformation of numerical data by centering and scaling it to a common reference, typically to a mean of zero and a standard deviation of one.
- preprocessingpart of · Preprocessing is the preparation or transformation of data, content, or other inputs into a form suitable for a subsequent computational operation.
- data leakageaddresses · Data leakage is the unintended exposure or use of information beyond its intended boundary, compromising confidentiality or the validity of model development and evaluation.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

