我对此有一个后续问题。与最初的问题一样,我正在使用 mlr3verse,拥有一个新数据集,并希望使用在自动调整期间表现良好的参数进行预测。该问题的答案是使用 at$train(task)。这似乎又开始了调优。它是否通过使用这些参数完全利用了嵌套重采样?
此外,查看 $tuning_result 有两组参数,一组称为 tune_x,一组称为 params。这些有什么区别?
谢谢。
编辑:下面添加的示例工作流
library(mlr3verse)
set.seed(56624)
task = tsk("mtcars")
learner = lrn("regr.xgboost")
tune_ps = ParamSet$new(list(
ParamDbl$new("eta", lower = .1, upper = .4),
ParamInt$new("max_depth", lower = 2, upper = 4)
))
at = AutoTuner$new(learner = learner,
resampling = rsmp("holdout"), # inner resampling
measures = msr("regr.mse"),
tune_ps = tune_ps,
terminator = term("evals", n_evals = 3),
tuner = tnr("random_search"))
rr = resample(task = task, learner = at, resampling = rsmp("cv", folds = 2),
store_models = TRUE)
rr$aggregate()
rr$score()
lapply(rr$learners, function(x) x$tuning_result)
at$train(task)
at$tuning_result
notreallynew.df = as.data.table(task)
at$predict_newdata(newdata = notreallynew.df)