The modeling pipeline is an important tool for machine learning practitioners.
Nevertheless, there are important implications that must be considered when using them.
The main confusion for beginners when using pipelines comes in understanding what the pipeline has learned or the specific configuration discovered by the pipeline.
For example, a pipeline may use a data transform that configures itself automatically, such as the RFECV technique for feature selection.
- When evaluating a pipeline that uses an automatically-configured data transform, what configuration does it choose? or When fitting this pipeline as a final model for making predictions, what configuration did it choose?
The answer is, it doesn’t matter.
Another example is the use of hyperparameter tuning as the final step of the pipeline.
The grid search will be performed on the data provided by any prior transform steps in the pipeline and will then search for the best combination of hyperparameters for the model using that data, then fit a model with those hyperparameters on the data.
- When evaluating a pipeline that grid searches model hyperparameters, what configuration does it choose? or When fitting this pipeline as a final model for making predictions, what configuration did it choose?
The answer again is, it doesn’t matter.