0

我想用图形学习器建立一个基准设计。从书中,我了解到使用预定义的学习器,我可以做这样的事情:

learners = c("classif.featureless", "classif.rpart", "classif.ranger", "classif.kknn")
learners = lapply(learners, lrn,
  predict_type = "prob", predict_sets = c("train", "test"))

# compare via 3-fold cross validation
resamplings = rsmp("cv", folds = 3)

# create a BenchmarkDesign object
design = benchmark_grid(tasks, learners, resamplings)
print(design

现在,我的图形学习器是这样定义的,仅通过参数不同FRacPar

gr_knn_pca = po("pca", center=TRUE, scale.=TRUE) %>>%
  po("filter", filter = mlr3filters::flt("variance"), filter.frac = FRacPar) %>>%
  po(lrn("classif.kknn", predict_type = "prob"),
     param_vals = list(k = k_chosen, distance=distance_chosen, kernel='rectangular' ))

我想要类似于第一个块的东西,所以我可以设置一个基准。我的输入将是一个分数向量,例如FRacPar_values=c(0.1,0.2,0.5,1)

我可以在这里继续吗?

4

0 回答 0