Skip to content
Quantoros

Numeric columns need scaling and categorical columns need one-hot encoding. Why is a single sequential Pipeline…

Classic MLLevel: FoundationHeterogeneous branches

Numeric columns need scaling and categorical columns need one-hot encoding. Why is a single sequential Pipeline insufficient by itself?

Hints
  • Distinguish sequential and parallel composition.
  • Columns need different routes.

Answer

Sequential steps receive the previous step's whole output. ColumnTransformer routes selected columns into separate transformations and concatenates outputs, then a Pipeline can fit the final model.

Source and licence: scikit-learn 1.7.2 — compose · BSD-3-Clause · answer: Quantoros editorial

Related questions