-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
Description
Describe the bug
The package cannot handle integer variables.
I was wondering if it is because of the Python version (currently I am using Python 3.10), or the feature is deprecated.
Ex:
from bayes_opt import BayesianOptimization
def target_function_1d(x):
return np.sin(np.round(x)) - np.abs(np.round(x) / 5)
# one way of constructing an integer-valued parameter is to add a third element to the tuple
d_pbounds = {'x': (-10, 10, int)}
bo_disc = BayesianOptimization(target_function_1d, d_pbounds, verbose=0, random_state=1)Error:
File ".../python3.10/site-packages/bayes_opt/target_space.py", line 84, in init
self._bounds: NDArray[Float] = np.array(
TypeError: float() argument must be a string or a real number, not 'type'