-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
Why?
Support for non-float parameters types is by far the most-request feature that this package doesn't have as of now.
Why this issue?
I would like to explicitly discuss if and how to implement parameter types. In that sense this issue isn't a feature request, but intended to server as a space to collect discussions about this topic.
How?
For my perspective, Garrido-Merchán and Hernández-Lobato seems to make the most sense.
This means converting the parameters within the kernel:
What is necessary?
Essentially all of this "only" requires three functions to transform the parameters:
- A function that converts the "canonical" representation of the parameters to the representation used by the kernel.
- float and int parameters remain unchangend, one-hot-encoding is applied to categorical variables
- A function that converts the kernel representation to the canonical representation, used whenever the user interacts with parameters (logs,
optimizer.max(), etc)- float and int parameters remain unchangend, reverse the one-hot-encoding.
- A function that converts the all-float parameter suggestions produced by
_space.random_sample()andacq_max()into kernel representation.
Naturally, it requires changing a lot of other code, too; and particularly in ways that make everything a bit messier. Additionally, wrapping the kernel requires some slightly hacky python magic due to the way sklearn.gaussian_process' kernels are set up.
Alternatives
Instead of offering proper support, we could simply refer users to @leifvan's implementation here. Alternatively, we could set up a notebook that demonstrates his approach. I'm almost favouring this approach since I'm worried about cluttering the API too much.
Are you able and willing to implement this feature yourself and open a pull request?
- Yes, I can provide this feature -- it's pretty much ready/functional too, I will push it soon and link it here.