ColumnTransformer

40 min
Block 18 — Professional pipelines
Objective
route a heterogeneous table column by column with a single fitted object; measure what the hand-rolled alternative costs when the index silently slips; master every form of a column specification, including the two dtype traps pandas 3.0 introduced; decide remainder deliberately; read get_feature_names_out well enough to attribute a coefficient to the column it came from; nest pipelines inside branches and address them through the preprocessor__num__imputer__strategy path; choose sparse or dense output on measured memory and fit time; use n_jobs where it pays; transform one column several ways; encode datetime columns as cyclical features; place a text vectorizer beside tabular branches without hitting the one-dimensional input rule; and survive the four forms of column drift.
Estimated duration
135 minutes
Prerequisites
chapters 018 and 019 (missing values, imputation), 022 (categorical encoding), 023 (feature scaling), 024 (feature engineering), 026 (train, validation, test), 028 (data leakage), 029 (fit, predict, predict_proba), 034 (cross-validation), 035 (hyperparameter tuning), 036 (logistic regression), 063 (ROC and AUC), 076 (the classification pipeline)
Associated quizzes
079.1-quiz-heterogeneous-tables.md to 079.9-quiz-column-drift.md

Preview — the rest of the lesson is for enrolled readers.

Already enrolled with a code?

Your access is tied to your account, not to this link. Sign in with the same email you used in class: your course is waiting, no need to enter the code again.

Sign inNo account yet? Create one
This lesson is part of the “Professional Scikit-learn Pipelines” module

The first modules of the course are open to everyone. For the rest you have three options: buy this course once and for all, subscribe, or enter the code handed out in class.

Are you a student on this course?

The code is tied to your account: sign in or create an account and it will be applied automatically when you come back.

No account yet? Create one