0

General question: Using scikit-optimize for a black box optimization. Can't find in the doc what model_queue_size does. I'm doing the ask-tell because I can parallelize the calculation of y as described in the example. So, doing some profiling, it looks like the opt.tell() call runs faster when model_queue_size is set smaller. Is that what model_queue_size does - limits the number of sample used in the opt.tell() call? 2nd question, how can I set kappa when using the Optimizier - ask-tell method?

thanks

Mark Sale
  • 65
  • 5

1 Answers1

1

When using the default model_queue_size=None all surrogate models are stored in the optimizer's models attribute. If a number is specified, only model_queue_size models will be remembered. That is in the the docs.
A new model is added each time tell is called and old models will be discarded once model_queue_size is reached. So only the most recent models are remembered. That can be seen by looking at the code.
Not sure why this would affect runtime in your case. I suppose if you run many iterations and models are very large it could be a memory thing.

Kappa can be set by using the acq_func_kwargs parameter of the Optimizer constructor as shown in the exploration vs exploitation example.

sply88
  • 643
  • 3
  • 7
  • Thanks, so much, that all makes sense. My model is fairly large, I think (11 dimensions, 4 categorical options in each dimension, running for up to ~600 steps). Does that count as large? Would ideally like to get it to maybe 16 dimensions, but slowing down a lot as the space and number of steps becomes bigger. I read that BE is limited to ~20 dimension, but wonder if that is for real valued dimensions and categorical is harder to update. – Mark Sale Dec 02 '21 at 20:09
  • So if all your dimensions are `space.Categorical` they would (by default) be one-hot-encoded and you would end up with 4 dimensions in the transformed search-space for each single dimension in your original space. Also I'm not sure if searching such a large all-discrete space works well with the kernel based gaussian process approach. Might be worth experimenting with different types of categorical encodings and/or tree based surrogate models. Would of course be a bit easier if at least some of the dimensions were ordered. – sply88 Dec 03 '21 at 15:26
  • Thanks (again). Yes, all the dimensions are categorical, although one is ordered categorical (but not integer). We're still looking for an algorithm, the contract actually called for reinforcement learning, but that didn't work at all. Would forest_minimize or gbrt_minimize make sense. Finally, can you point me to how to code ordered categorical, I only see real, integer and categorical? Or perhaps integer can be used (even though the interval between the categories is not the same, but they are ordered) – Mark Sale Dec 04 '21 at 17:00
  • Integer could be used. This would be the same as using Categorical with `transform="label"`. For tree based models order matters, so different intervals between categories would not be an issue. – sply88 Dec 05 '21 at 08:06
  • thanks, running that now. – Mark Sale Dec 06 '21 at 16:51