【问题标题】:How to predict new datasets after the `tune_nested`?如何在“tune_nested”之后预测新的数据集?
【发布时间】:2022-02-18 14:30:33
【问题描述】:
# retrieve task
task = tsk(\"pima\")

# load learner and set search space
learner = lrn(\"classif.rpart\", cp = to_tune(1e-04, 1e-1, logscale = TRUE))

# nested resampling
rr = tune_nested(
  method = \"random_search\",
  task =  task,
  learner = learner,
  inner_resampling = rsmp(\"holdout\"),
  outer_resampling = rsmp(\"cv\", folds = 3),
  measure = msr(\"classif.ce\"),
  term_evals = 10,
  batch_size = 5
)

因此,如果现在我定义一个新数据集:

new_data = as.data.table(task)[1:10,]

如何预测 new_data 的结果?

    标签: mlr3


    【解决方案1】:

    请记住,嵌套重采样是一种统计过程,用于估计在完整数据集上训练的模型的预测性能。嵌套重采样不是选择最佳超参数的过程。重采样会产生许多不应用于构建最终模型的超参数配置。

    mlr3book 第 4.3 节“nested resampling

    画廊帖子“Practical Tuning Series - Tune a Support Vector Machine”提供了一个实际示例,说明如何构建预测模型以及使用什么嵌套重采样。

    【讨论】:

      猜你喜欢
      • 2021-03-20
      • 2021-05-31
      • 1970-01-01
      • 1970-01-01
      • 2018-05-20
      • 2020-03-03
      • 1970-01-01
      • 1970-01-01
      • 2022-02-17
      相关资源
      最近更新 更多