How to save 50% tuned results mlr3 and continue tune 50% tomorrow

82 Views Asked by At

Example codes

library(mlr3verse)
library(paradox)
library(drake)


my_plan = drake::drake_plan(
  # learner
  learner_classif = lrn(
    "classif.ranger",
    predict_type = "prob"
  ),
  
  # task 
  task = tsk("german_credit"),
  
  # set search_space
  ps_classif = ParamSet$new(list(
    ParamInt$new("num.trees", lower = 300, upper = 500),
    ParamDbl$new("sample.fraction", lower = 0.7, upper = 0.8)
  )),
  
  # auto tunning
  at = AutoTuner$new(
    learner = learner_classif, 
    resampling = rsmp("cv", folds = 3),
    measure = msr("classif.auc"), 
    search_space = ps_classif, 
    terminator = trm("evals", n_evals = 1000), 
    tuner = tnr("random_search")
  ),
  
  # sampling
  rr = resample(task, at, rsmp("cv", folds = 2))
)

make(my_plan)

I have a problem when tuning model in mlr3. If the model has a lot of nodes' in the graph or n_evals` too many. I cant run during the day. I intend to divide this job to 2 days: 50% in first day, 50% in second day.

May i ask.

How to append tuned results at the first day and second day?

Or how to i can stop tuning at anytime and continue at another time (while the result is still enough) ?

Thanks !!!

0

There are 0 best solutions below