How to specify Latin Hypercube Sampling in the auto_tuner function of the mlr3 package in R for bayesian optimization

I’m conducting Bayesian optimization to tune hyperparameters of machine learning models using the mlr3 package in R. To do this,
I would like to perform Latin hypercube sampling using the paradox::generate_design_lhs() function. Unfortunately, I am not sure how to specify
Latin hypercube sampling in the mlr3tuning::auto_tuner function because I am getting this error message:

Error in UseMethod("as_search_space") :
no applicable method for 'as_search_space' applied to an object of class c('Design', 'R6')

Any help would be greatly appreciated.

Here is a reproducible example:

tsk_sonar = tsk("sonar")

search_space = paradox::ps(cost = paradox::p_dbl(lower = 1e-1, upper = 1e5), gamma = paradox::p_dbl(lower = 1e-1, upper = 1))
search_space = paradox::generate_design_lhs(search_space, n = 100)

at = mlr3tuning::auto_tuner(tuner = mlr3tuning::tnr("mbo"),
learner = mlr3::lrn("classif.svm", predict_type = "prob", kernel = "radial", type = "C-classification"),
resampling = mlr3::rsmp("cv", folds = 4),
measure = mlr3::msr("classif.auc"),
search_space = search_space,
terminator = mlr3tuning::trm("evals", n_evals = 20))

rr = mlr3::resample(tsk_sonar, at, rsmp("cv", folds = 3), store_models = TRUE)

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.