mlrMBO icon indicating copy to clipboard operation
mlrMBO copied to clipboard

makeMBOControl uses 4*d for initial design

Open giuseppec opened this issue 8 years ago • 17 comments

When we use mlr:::makeTuneControlMBO in mlr, the default uses 4*d for initial design, this should be configurable also the type of the initial design.

giuseppec avatar Jan 11 '17 14:01 giuseppec

mbo.iters = budget - 4*length(ps$pars)
surrogate.lrn = makeLearner("regr.km", predict.type = "se", nugget = 10^-6)
mbo.ctrl = makeMBOControl()
mbo.ctrl = setMBOControlTermination(mbo.ctrl, iters = mbo.iters)
mbo.ctrl = mlr:::makeTuneControlMBO(learner = surrogate.lrn, mbo.control = mbo.ctrl)

giuseppec avatar Jan 11 '17 14:01 giuseppec

You can pass your own design with mlr:::makeTuneControlMBO(..., mbo.design = generateDesign(n = 4*length(ps$pars), fun = randomLHS)). Is that sufficient?

jakob-r avatar Jan 12 '17 08:01 jakob-r

Have a look at the code snippet. We are in mlr. You don't want to create the design here yourself but possibly change its size.

berndbischl avatar Jan 12 '17 09:01 berndbischl

Wait I didn't read your full post. Maybe we should simply doc this in mlr?

berndbischl avatar Jan 12 '17 09:01 berndbischl

But I still have the suspicion that it is better to add the init des size option back to mbo

berndbischl avatar Jan 12 '17 09:01 berndbischl

I'm in for a better documentation. But in this case I don't favor more function arguments that kind of "rival" with existing arguments (i.e. mbo.design) and thus will clutter the code more just to take some easy work from the user. @giuseppec You might also like this setMBOControlTermination(mbo.ctrl, max.evals = budget)

jakob-r avatar Jan 12 '17 16:01 jakob-r

it really does not make the package better to hardcode this parameter as 4 internally. expose it and close here.

berndbischl avatar Jan 12 '17 17:01 berndbischl

(max.evals I already showed to Giuseppe)

berndbischl avatar Jan 12 '17 17:01 berndbischl

My way of thinking: I want to try to avoid settings/arguments that conflict each other. Of course the 4 is not always perfect but it's just a default and it's super easy to change it to e.g. 5 yourself by calling mlr:::makeTuneControlMBO(..., mbo.design = generateDesign(n = 5*sum(getParamLengths(ps)), fun = randomLHS))

What is your suggestion? mlr:::makeTuneControlMBO(..., mbo.design.points.mulitplier = 5) or mlr:::makeTuneControlMBO(..., mbo.design.points = 20).

jakob-r avatar Jan 13 '17 10:01 jakob-r

My suggestion is to expose the init.design.size in mlrMBO

berndbischl avatar Jan 13 '17 10:01 berndbischl

And its not "super easy" currently. Giuseppe is kinda part of our internal team and he did not find this....

berndbischl avatar Jan 13 '17 10:01 berndbischl

... because it is not well enough documented :wink:.

Maybe we have to come to a democratic decision. I am summoning @mllg, @jakobbossek @danielhorn.

jakob-r avatar Jan 16 '17 15:01 jakob-r

I do not like the init.design.size parameter. We once had a similar parameter in mbo and decided to create designs externally. +1 for the following code by @jakob-r:

mlr:::makeTuneControlMBO(..., mbo.design = generateDesign(n = 5*sum(getParamLengths(ps)), fun = randomLHS))

jakobbossek avatar Jan 16 '17 15:01 jakobbossek

i still disagree. we removed init.design.size because we wanted to simplify the interface. for mbo this is the case, now, for mlr it is not.

the point is simply: the code posted above is completely ugly. and you have to type it in for a very basic and fundamental feature option. an option that already "exists", which we have internally hardcoded with 4. that is surely not good API design.

just because we did that, does not proof it right.

its potentially minor point (if this is at least documented.....! in mlr now too! which you would not need if there would be a clearly understandable option....), but that the design here is not good seems pretty obvious to me.

berndbischl avatar Jan 16 '17 18:01 berndbischl

Let's put it in other words: I still don't like it and I find it strage that we introduce an option in the mlr->mlrMBO Interface that does not even exist in mlrMBO. But this opinion is just so strong that I would not want to do it myself. If you find someone who does it I surely would merge it.

jakob-r avatar Jan 20 '17 08:01 jakob-r

an option in the mlr->mlrMBO Interface that does not even exist in mlrMBO.

shall we talk about this orally? i am talking DIRECTLY about the mlrMBO API itself (yes, this helps with the mlr interaction, which was the reason to open the issue here)

I will simply do a PR

(or lets continue arguing.... but then on hangout pls)

berndbischl avatar Jan 20 '17 09:01 berndbischl

+1, I today had a another problem / inconvenience as the init.des.size option was not there

berndbischl avatar Mar 16 '17 13:03 berndbischl