paulknysh / blackbox

A Python module for parallel optimization of expensive black-box functions
MIT License
439 stars 60 forks source link

Integer / categorical parameters #23

Open beojan opened 4 years ago

beojan commented 4 years ago

Is there a way to limit parameters to integers only? I'm currently rounding the parameter in the objective function, but this leads to the same value being evaluated multiple times.

paulknysh commented 4 years ago

The method/code was originally designed assuming that parametric space is continuous. Therefore, yes, for monotonic integers within a given range you can do rounding trick - I did that myself few times, seems to work well. There is no specific input format for integer parameters at the moment.

As for the categorical parameters in general case (non-integers), those obviously don't guarantee continuity (since their order is arbitrary) and therefore, I believe, the only way to proceed is to perform multiple optimizations for each combination of those parameters.