我正在使用 mlr3 使用 SVM 分类器构建机器学习工作流。当我尝试调整参数时
library(mlr3)
library(mlr3learners)
library(paradox)
library(mlr3tuning)
task = tsk("pima")
learner = lrn("classif.svm")
learner$param_set
tune_ps = ParamSet$new(list(
ParamDbl$new("cost", lower = 0.001, upper = 0.1)
))
tune_ps
hout = rsmp("holdout")
measure = msr("classif.ce")
evals20 = term("evals", n_evals = 20)
instance = TuningInstance$new(
task = task,
learner = learner,
resampling = hout,
measures = measure,
param_set = tune_ps,
terminator = evals20
)
tuner = tnr("grid_search", resolution = 10)
result<-tuner$tune(instance)
它输出错误
(函数(xs)中的错误:“xs”上的断言失败:“成本”的条件不正确:类型等于 C 分类;而是:类型 =
我无法弄清楚那里发生了什么。