hyperopt
hyperopt copied to clipboard
Single condition for several parameters?
How can I add my own condition for example:
a = hp.uniform('a', 0.0, 1.0) b = hp.uniform('b', 0.0, 1.0) c = hp.uniform('c', 0.0, 1.0)
And sum of a, b and c must be equal to one ?
Use softmax in the function?
One solution can be seen at https://github.com/hyperopt/hyperopt/issues/337 -- adding you own penalty. Anyhow, in the source it says that this approach was not too successful.
Another idea which comes to my mind is to guess a and b and later in the objective function you can derive c from both. But definitely this solution adds obvious further constraints and that might not be desirable.
a = hp.uniform('a', 0.0, 0.5)
b = hp.uniform('b', 0.0, 0.5)
You could of course also rescale the variables in the objective function by any means that guarantees the ranking (x1 < x2 => f(x1) < f(x2)) (also see the softmax approach). Still this might not be really smart because of the KDE approach which works on x1 instead of f(x1).
This issue has been marked as stale because it has been open 120 days with no activity. Remove the stale label or comment or this will be closed in 30 days.