As machine learning pipelines become more complex, I find myself struggling with a design question rather than a coding one.
When you’re working with scikit-learn’s Pipeline and ColumnTransformer, where do you place custom feature creation logic?
For example:
- Creating interaction features
- Extracting date-based features
- Combining multiple columns into a new feature
- Domain-specific transformations
Some practitioners add these steps before the ColumnTransformer, while others treat feature engineering as part of preprocessing and keep everything inside a single pipeline.
On one hand, keeping everything in the pipeline improves reproducibility and prevents training-serving skew. On the other hand, deeply nested transformers can become difficult to debug and maintain.
I’m curious how experienced ML engineers structure their workflows:
- Do you separate feature engineering from preprocessing?
- Do you use custom transformers extensively?
- How do you keep pipelines both reproducible and understandable as projects grow?
Interested in hearing real-world approaches, especially from teams managing large production ML workflows.
