Session Ready
Exercise

Customizing the grid search

In the previous exercise you conducted a default grid search to optimize the C and sigma hyperparameters of your SVM radial model. Although quite easy to do, it was a pity that you did not have any control over the candidate hyperparameter vectors that were tried during the grid search.

But that's about to change! You will be using the expand.grid() function provided by caret to specify the set of values for each hyperparameter. Then, the grid search will be carried out over the Cartesian product of each of those sets. You can then use the resulting hyperparameter grid in a call to the train() function by means of the tuneGrid argument.

Let's go ahead and try that! As before, the caret package has been loaded and the car_train dataset is available in your workspace.

Instructions 1/4
undefined XP
  • 1
  • 2
  • 3
  • 4
  • Create a train control object named trc corresponding to a single 10-fold cross validation.