Tuning the hyperparameters using a direct genetic approach
Besides offering an efficient grid search option, genetic algorithms can be utilized to directly search the entire parameter space, just as we used them to search the input space for many types of problems throughout this book. Each hyperparameter can be represented as a variable participating in the search, and the chromosome can be a combination of all these variables.
Since the hyperparameters can be of varying types—for example, the types float, int, and enumerated, which we have in our AdaBoost classifier—we may want to code each of them differently and then define the genetic operations as a combination of separate operators that are adapted to each of the types. However, we can also use a lazy approach and code all of them as float parameters to simplify the implementation of the algorithm, as we will see next.
Hyperparameter representation
In Chapter 6, Optimizing Continuous Functions, we used...