Tuning the hyperparameters using conventional versus genetic grid search
To encapsulate the hyperparameter tuning of the AdaBoost classifier for the Wine dataset using a grid search—both the conventional version and the genetic-algorithm-driven version—we created a Python class called HyperparameterTuningGrid
. This class can be found in the 01_hyperparameter_tuning_grid.py
file, which is located at
The main parts of this class are highlighted as follows:
- The
__init__()
method of the class initializes the wine dataset, the AdaBoost classifier, the k-fold cross-validation metric, and the grid parameters:self.initWineDataset() self.initClassifier() self.initKfold() self.initGridParams()
- The
initGridParams()
method initializes the grid search by setting the tested values of the three hyperparameters mentioned in...