You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cannot import name 'acquisition' from 'bayes_opt' #500
I have installed bayesian optimization 1.5.1 and whenever I am trying to import acquisition by typing
from bayes_opt import acquisition,
it returns
ImportError: cannot import name 'acquisition' from 'bayes_opt' (C:\Users\ldhy9\AppData\Local\Programs\Python\Python311\Lib\site-packages\bayes_opt_init_.py)
you're very fast! We merged a PR recently that changed the acquisition function and docs are hosted based on master. However, we haven't pushed the release yet. The notebook for v1.5.1 can be found here. Hope that helps!
To clarify, are "utility" and "acquisition" functions referring to the same thing? Thus, would
acquisition_function = acquisition.ExpectedImprovement(xi=0.1)
be equivalent to
utility_function = UtilityFunction(kind="ei", xi=0.1)
???
(The latter one works and avoids this import issue)
In short, the code you describe shows how to do the exact same thing in different versions, so you can consider them conceptually the same.
To be more specific, the old way acquisition functions were implemented was somewhat inflexible and convoluted. This code has been overhauled and is what you can find on master. However, it's not yet released. As the code documentation online is based on what you can find on master (as of now, I'm working on this, see #509) you're seeing the code for the newer, yet to be released, version while probably using an older one.
I hope that clears up the confusion. Apologies for any inconveniences.
Activity
t-muser commentedon Jul 16, 2024
Hi @dinghly,
you're very fast! We merged a PR recently that changed the acquisition function and docs are hosted based on
master. However, we haven't pushed the release yet. The notebook for v1.5.1 can be found here. Hope that helps!dinghly commentedon Jul 16, 2024
Thank you so much for your quick help!
evancollins1 commentedon Aug 15, 2024
Hi, I'm also having troubles with
from bayes_opt import acquisition
To clarify, are "utility" and "acquisition" functions referring to the same thing? Thus, would
acquisition_function = acquisition.ExpectedImprovement(xi=0.1)
be equivalent to
utility_function = UtilityFunction(kind="ei", xi=0.1)
???
(The latter one works and avoids this import issue)
Thanks
t-muser commentedon Aug 15, 2024
Hi @evancollins1,
In short, the code you describe shows how to do the exact same thing in different versions, so you can consider them conceptually the same.
To be more specific, the old way acquisition functions were implemented was somewhat inflexible and convoluted. This code has been overhauled and is what you can find on master. However, it's not yet released. As the code documentation online is based on what you can find on master (as of now, I'm working on this, see #509) you're seeing the code for the newer, yet to be released, version while probably using an older one.
I hope that clears up the confusion. Apologies for any inconveniences.