Scikit-learn's Pipeline class is designed as a manageable way to apply a series of data transformations followed by the application of an estimator.
Build 3 pipelines, each with a different estimators, using default hyperparameters:
Build a pipeline for transform, consisting of:
Then, the data is fitted to the final estimators.
To simulate a full-fledged workflow:
We will construct pipelines for Logistic Regression, Support Vector Machine and Decision Tree
Another simple yet powerful technique we can pair with pipelines to improve performance is grid search, which attempts to optimize model hyperparameter combinations.
As summary, we applied feature scaling (scaler), dimensionality reduction (pca), and applied the final estimator (clf)
The purpose of grid search is to locate the optimal hyperparameters to optimize the model's accuracy. Grid Search will be applied to optimize the following hyperparameters: