0

示例代码

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)

在 mlr3 中调整模型时出现问题。如果模型的a lot of nodes' in the graph or n_evals 太多。白天不能跑步。我打算把这份工作分成两天:第一天50%,第二天50%。

请问一下。

如何在第一天和第二天附加调整结果?

或者我如何可以随时停止调整并在另一个时间继续(结果仍然足够)?

谢谢 !!!

4

0 回答 0