Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'float' object is not subscriptable #315

Closed
ayushvrma opened this issue Apr 25, 2022 · 1 comment
Closed

'float' object is not subscriptable #315

ayushvrma opened this issue Apr 25, 2022 · 1 comment

Comments

@ayushvrma
Copy link

I'm using the code from one of the tutorial notebooks in the repo:
My target function is:

def target(x):
    return np.exp(-(x - 2)**2) + np.exp(-(x - 6)**2/10) + 1/ (x**2 + 1)

x = np.linspace(-2, 10, 10000).reshape(-1, 1)
y = target(x)

plt.plot(x, y);

and my optimiser is defined as follows:

optimizer = BayesianOptimization(f=target, pbounds={'x': (-2, 10)}, random_state=27)
optimizer.maximize(init_points=2, n_iter=2, kappa=5)

it works well when number of iterations = 0, I'm new to the codebase could someone help me solve the issue?

@bwheelz36
Copy link
Collaborator

Hey, please see #300 - you need to use a lower version of scipy, or else you can edit the source code as described below.
#303
Sorry, hopefully this will be fixed by default in the near future

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants