Sampling hyperparameters
Inside the search space, hyperparameters are either continuous or discrete values. Continuous hyperparameters can be in a continuous range of values, while discrete hyperparameters are only able to use certain values. For logistic regression, the penalty term can have one of two discrete values: l1
or l2
. AMLS can use either a list or a range for setting hyperparameters, as we will see when we dig into the code.
For the hyperparameter of C
, we could define it as a discrete value, or we could define C to be a value in a continuous range with a specified distribution.
For the max_iter
hyperparameter, the default value for the sklearn
logistic regression model is 100
. We could set this to a discrete value such as penality_term
, or a uniform value such as C
.
The following code shown in Figure 4.4 defines the search space for the penalty term, the inverse regularization strength of the model, and the maximum iterations as choices, which are discrete values...