ComeçarComece de graça

Cartesian grid search in caret

In chapter 1, you learned how to use the expand.grid() function to manually define hyperparameters. The same function can also be used to define a grid of hyperparameters.

The voters_train_data dataset has already been preprocessed to make it a bit smaller so training will run faster; it has now 80 observations and balanced classes and has been loaded for you. The caret and tictoc packages have also been loaded and the trainControl object has been defined with repeated cross-validation:

fitControl <- trainControl(method = "repeatedcv",
                           number = 3,
                           repeats = 5)

Este exercício faz parte do curso

Hyperparameter Tuning in R

Ver curso

Exercício interativo prático

Experimente este exercício completando este código de exemplo.

# Define Cartesian grid
man_grid <- ___(degree = ___, 
                scale = ___, 
                C = ___)
Editar e executar o código