Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Is custom resampling with AutoTuner supported? #207

@sguidi11

Description

@sguidi11

I am using a custom resampling within the AutoTuner function.
I am getting back an error which I can't unfortunately understand.
Any idea?

task = tsk("pima")
set.seed(123)


resampling = rsmp("custom")
train_sets = list(1:300 , 332:632, 633:738)
test_sets = list(301:331, 633:663, 739:768)
resampling$instantiate(task, train_sets, test_sets) 


learner = lrn("classif.rpart")
#resampling = rsmp("holdout")
measures = msr("classif.ce")
tune_ps = ParamSet$new(list(
  ParamDbl$new("cp", lower = 0.001, upper = 0.1),
  ParamInt$new("minsplit", lower = 1, upper = 10)
))
terminator = term("evals", n_evals = 10)
tuner = tnr("random_search")

at = AutoTuner$new(
  learner = learner,
  resampling = resampling,
  measures = measures,
  tune_ps = tune_ps,
  terminator = terminator,
  tuner = tuner
)
at
at$train(task)
**Error in self$resampling$instantiate(self$task) : 
  Assertion on 'train_sets' failed: Must be of type 'list', not 'NULL'.**

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions