mlrMBO
mlrMBO copied to clipboard
FocusSearch doesn't handle discrete vector parameters
In particular, I reliably get an error here when I have a discrete vector parameter, since val
is a list and setdiff(val.names, val)
can make val.names
empty even when it was length(par$values) > 1L
before.
Should I, in general, assume that mlrMBO wasn't designed to handle vector parameters and give up right now, or is this worth a fix?
Addendum: this is a bug anyway since to.del
is a number and always ranges from 1 to length(par$values) - 1
, no matter what val
was.
As commented in PR #202, infillOptFocus cannot, in principle, handle parameters that have requirements depending on discrete vector parameters. One would need to either adapt something in ParamHelpers or automatically rewrite the requirements and decompose vector params into scalar params. This is a bit tricky, but I've done something similar here with the help of this function.
@berndbischl Please review PR #202 PR #257
@berndbischl: ping