Skip to content

Commit ac43548

Browse files
author
brendan
committed
added deprecation warning to maximize
1 parent 4f2b735 commit ac43548

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

bayes_opt/bayesian_optimization.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,13 @@ def _prime_subscriptions(self):
246246
def maximize(self,
247247
init_points=5,
248248
n_iter=25,
249-
acquisition_function=None):
249+
acquisition_function=None,
250+
acq=None,
251+
kappa=None,
252+
kappa_decay=None,
253+
kappa_decay_delay=None,
254+
xi=None,
255+
**gp_params):
250256

251257
"""
252258
Probes the target space to find the parameters that yield the maximum
@@ -270,6 +276,14 @@ def maximize(self,
270276
self.dispatch(Events.OPTIMIZATION_START)
271277
self._prime_queue(init_points)
272278

279+
old_params_used = any([param is not None for param in [acq, kappa, kappa_decay, kappa_decay_delay, xi]])
280+
if old_params_used or gp_params:
281+
warnings.warn('\nPassing acquisition function parameters or gaussian process parameters to maximize'
282+
'\nis no longer supported, and will cause an error in future releases. Instead,'
283+
'\nplease use the "set_gp_params" method to set the gp params, and pass an instance'
284+
'\n of bayes_opt.util.UtilityFunction using the acquisition_function argument\n',
285+
DeprecationWarning, stacklevel=2)
286+
273287
if acquisition_function is None:
274288
util = UtilityFunction(kind='ucb',
275289
kappa=2.576,

0 commit comments

Comments
 (0)