mlr-org / mlr3tuning

Hyperparameter optimization package of the mlr3 ecosystem
https://mlr3tuning.mlr-org.com/
GNU Lesser General Public License v3.0
53 stars 5 forks source link

TuningInstance$archive("params") seems to fail if there are function parameters #201

Closed mb706 closed 4 years ago

mb706 commented 4 years ago

e.g. when tuning a pipeine which contains a PipeOpSelect, with the selector argument which takes function values. This is the case even if this selector argument is not the one bein tuned.

berndbischl commented 4 years ago

pls provide a mini example, so we can work against that

mb706 commented 4 years ago
inst = TuningInstance$new(tsk("iris"),
  po("select") %>>% lrn("classif.rpart"),
  rsmp("holdout"), msr("classif.ce"),
  paradox::ParamSet$new(list(
    paradox::ParamInt$new("classif.rpart.minsplit", 1, 1))),
  term("evals", n_evals=1))

tnr("random_search")$tune(inst)
inst$archive("params")

gives

Error in rbindlist(x[[col]], fill = TRUE, use.names = TRUE) : 
  cannot coerce type 'closure' to vector of type 'logical'
berndbischl commented 4 years ago

well its very obvious and unsurprising what happens. "params" contains non-scalar entries (tune_x can only contain scalar entries, because we decided on this restriction for paradox)

in your case that is the "selector", which is a function, as you mentioned.

and mlr3misc::unnest fails.

now tell me what you want as a result? "selector" in a list-column? then you have to open up the issue in mlr3misc

@mllg

berndbischl commented 4 years ago

michels PR in mlr3misc solvd the problem, for good measure we can still add a test here when mergen then close