调整两个以上的超参数时,必须使用partial.dep请求部分依赖吗?

时间:2019-04-23 00:53:44

标签: r mlr

我正在调整两个以上的超参数,而使用函数generateHyperParsEffectData生成超参数效果数据时,我设置了part.dep = TRUE,同时绘制plotHyperParsEffect时,分类学习器出现错误,它需要回归学习器

这是我的任务和分类学习者

classif.task <- makeClassifTask(id = "rfh2o.task", data = Train_clean, target = "Action")
rfh20.lrn.base = makeLearner("classif.h2o.randomForest", predict.type = "prob",fix.factors.prediction=TRUE)
rfh20.lrn <- makeFilterWrapper(rfh20.lrn.base, fw.method = "chi.squared", fw.perc = 0.5)

这是我的调音

rdesc <- makeResampleDesc("CV", iters = 3L, stratify = TRUE)
ps<- makeParamSet(makeDiscreteParam("fw.perc", values = seq(0.2, 0.8, 0.1)),
                         makeIntegerParam("mtries", lower = 2, upper = 10), 
                         makeIntegerParam("ntrees", lower = 20, upper = 50)
                         )
Tuned_rf <- tuneParams(rfh20.lrn, task = QBE_classif.task, resampling = rdesc.h2orf, par.set = ps.h2orf, control = makeTuneControlGrid())

在绘制曲调时

h2orf_data = generateHyperParsEffectData(Tuned_rf, partial.dep = TRUE) 
plotHyperParsEffect(h2orf_data, x = "iteration", y = "mmce.test.mean", plot.type = "line", partial.dep.learn =rfh20.lrn)

我收到错误消息

Error in checkLearner(partial.dep.learn, "regr") :
  Learner 'classif.h2o.randomForest.filtered' must be of type 'regr', not: 'classif'

我希望能看到更多调整需求的图,以便添加更多的超调整功能,如果我错过了一些东西。

1 个答案:

答案 0 :(得分:1)

partial.dep.learn参数需要回归学习器;参见the documentation