Skip to contents

This CallbackTuning writes the mlr3::BenchmarkResult after each batch to disk.

Examples

clbk("mlr3tuning.backup", path = "backup.rds")
#> <CallbackTuning:mlr3tuning.backup>: Backup Benchmark Result Callback
#> * Active Stages: on_optimizer_after_eval, on_optimization_begin

# tune classification tree on the pima data set
instance = tune(
  tuner = tnr("random_search", batch_size = 2),
  task = tsk("pima"),
  learner = lrn("classif.rpart", cp = to_tune(1e-04, 1e-1, logscale = TRUE)),
  resampling = rsmp("cv", folds = 3),
  measures = msr("classif.ce"),
  term_evals = 4,
  callbacks = clbk("mlr3tuning.backup", path = tempfile(fileext = ".rds"))
)