Attempting my first randomForest model in R and am working through tuning hyperparameters. I created a spec first: tune_spec<- decision_tree() %>% set_engine("rpart") %>% set_mode("regression")
And then I tried to create a tuning grid: tree_grid<- grid_regular(parameters(tune_spec), levels=3)
but I got this error:
Error in parameters():
! parameters objects cannot be created from objects of class decision_tree.
The
parameters()function was deprecated in 0.2.0 of {tune} (2022-03-18). The function to use isextract_parameter_set_dials().We are getting back a empty parameters object, because you need to specify which variables you want to use with
tune()And once you have done that, then you can pass it to
grid_regular()or the other functions