class_docstr: This class takes the function to optimize as well as the parameters bounds
  in order to find which values for the parameters yield the maximum value
  using bayesian optimization.
  
  Parameters
  ----------
  f: function
      Function to be maximized.
  
  pbounds: dict
      Dictionary with parameters names as keys and a tuple with minimum
      and maximum values.
  
  constraint: A ConstraintModel. Note that the names of arguments of the
      constraint function and of f need to be the same.
  
  random_state: int or numpy.random.RandomState, optional(default=None)
      If the value is an integer, it is used as the seed for creating a
      numpy.random.RandomState. Otherwise the random state provided is used.
      When set to None, an unseeded random state is generated.
  
  verbose: int, optional(default=2)
      The level of verbosity.
  
  bounds_transformer: DomainTransformer, optional(default=None)
      If provided, the transformation is applied to the bounds.
  
  allow_duplicate_points: bool, optional (default=False)
      If True, the optimizer will allow duplicate points to be registered.
      This behavior may be desired in high noise situations where repeatedly probing
      the same point will give different answers. In other situations, the acquisition
      may occasionally generate a duplicate point.
  
  Methods
  -------
  probe()
      Evaluates the function on the given points.
      Can be used to guide the optimizer.
  
  maximize()
      Tries to find the parameters that yield the maximum value for the
      given function.
  
  set_bounds()
      Allows changing the lower and upper searching bounds
class_docstr_tok: ["This","class","takes","the","function","to","optimize","as","well","as","the","parameters","bounds","in","order","to","find","which","values","for","the","parameters","yield","the","maximum","value","using","bayesian","optimization",".","Parameters","--","--","--","--","--","f",":","function","Function","to","be","maximized",".","pbounds",":","dict","Dictionary","with","parameters","names","as","keys","and","a","tuple","with","minimum","and","maximum","values",".","constraint",":","A","ConstraintModel",".","Note","that","the","names","of","arguments","of","the","constraint","function","and","of","f","need","to","be","the","same",".","random_state",":","int","or","numpy.random.RandomState",",","optional","(","default=None",")","If","the","value","is","an","integer",",","it","is","used","as","the","seed","for","creating","a","numpy.random.RandomState",".","Otherwise","the","random","state","provided","is","used",".","When","set","to","None",",","an","unseeded","random","state","is","generated",".","verbose",":","int",",","optional","(","default=2",")","The","level","of","verbosity",".","bounds_transformer",":","DomainTransformer",",","optional","(","default=None",")","If","provided",",","the","transformation","is","applied","to","the","bounds",".","allow_duplicate_points",":","bool",",","optional","(","default=False",")","If","True",",","the","optimizer","will","allow","duplicate","points","to","be","registered",".","This","behavior","may","be","desired","in","high","noise","situations","where","repeatedly","probing","the","same","point","will","give","different","answers",".","In","other","situations",",","the","acquisition","may","occasionally","generate","a","duplicate","point",".","Methods","--","--","--","-","probe","(",")","Evaluates","the","function","on","the","given","points",".","Can","be","used","to","guide","the","optimizer",".","maximize","(",")","Tries","to","find","the","parameters","that","yield","the","maximum","value","for","the","given","function",".","set_bounds","(",")","Allows","changing","the","lower","and","upper","searching","bounds"]
docstr: Probes the target space to find the parameters that yield the maximum
  value for the given function.
  
  Parameters
  ----------
  init_points : int, optional(default=5)
      Number of iterations before the explorations starts the exploration
      for the maximum.
  
  n_iter: int, optional(default=25)
      Number of iterations where the method attempts to find the maximum
      value.
  
  acquisition_function: object, optional
      An instance of bayes_opt.util.UtilityFunction.
      If nothing is passed, a default using ucb is used
  
  All other parameters are unused, and are only available to ensure backwards compatibility - these
  will be removed in a future release
docstr_tok: ["Probes","the","target","space","to","find","the","parameters","that","yield","the","maximum","value","for","the","given","function",".","Parameters","--","--","--","--","--","init_points",":","int",",","optional","(","default=5",")","Number","of","iterations","before","the","explorations","starts","the","exploration","for","the","maximum",".","n_iter",":","int",",","optional","(","default=25",")","Number","of","iterations","where","the","method","attempts","to","find","the","maximum","value",".","acquisition_function",":","object",",","optional","An","instance","of","bayes_opt.util.UtilityFunction",".","If","nothing","is","passed",",","a","default","using","ucb","is","used","All","other","parameters","are","unused",",","and","are","only","available","to","ensure","backwards","compatibility","-","these","will","be","removed","in","a","future","release"]
code: def maximize(
      self,
      init_points=5,
      n_iter=25,
      acquisition_function=None,
      acq=None,
      kappa=None,
      kappa_decay=None,
      kappa_decay_delay=None,
      xi=None,
      **gp_params,
  ):
      """
      Probes the target space to find the parameters that yield the maximum
      value for the given function.
  
      Parameters
      ----------
      init_points : int, optional(default=5)
          Number of iterations before the explorations starts the exploration
          for the maximum.
  
      n_iter: int, optional(default=25)
          Number of iterations where the method attempts to find the maximum
          value.
  
      acquisition_function: object, optional
          An instance of bayes_opt.util.UtilityFunction.
          If nothing is passed, a default using ucb is used
  
      All other parameters are unused, and are only available to ensure backwards compatibility - these
      will be removed in a future release
      """
      self._prime_subscriptions()
      self.dispatch(Events.OPTIMIZATION_START)
      self._prime_queue(init_points)
  
      old_params_used = any(
          [
              param is not None
              for param in [
                  acq,
                  kappa,
                  kappa_decay,
                  kappa_decay_delay,
                  xi,
              ]
          ]
      )
      if old_params_used or gp_params:
          raise Exception(
              "\nPassing acquisition function parameters or gaussian process parameters to maximize"
              '\nis no longer supported. Instead,please use the "set_gp_params" method to set'
              "\n the gp params, and pass an instance of bayes_opt.util.UtilityFunction"
              "\n using the acquisition_function argument\n"
          )
  
      if acquisition_function is None:
          util = UtilityFunction(
              kind="ucb",
              kappa=2.576,
              xi=0.0,
              kappa_decay=1,
              kappa_decay_delay=0,
          )
      else:
          util = acquisition_function
  
      iteration = 0
      while not self._queue.empty or iteration < n_iter:
          try:
              x_probe = next(self._queue)
          except StopIteration:
              util.update_params()
              x_probe = self.suggest(util)
              iteration += 1
          self.probe(x_probe, lazy=False)
  
          if self._bounds_transformer and iteration > 0:
              # The bounds transformer should only modify the bounds after
              # the init_points points (only for the true iterations)
              self.set_bounds(
                  self._bounds_transformer.transform(self._space)
              )
  
      self.dispatch(Events.OPTIMIZATION_END)
  
imports: import warnings
  from bayes_opt.constraint import ConstraintModel
  from .target_space import TargetSpace
  from .event import Events, DEFAULT_EVENTS
  from .logger import _get_default_logger
  from .util import UtilityFunction, acq_max, ensure_rng
  from sklearn.gaussian_process.kernels import Matern
  from sklearn.gaussian_process import GaussianProcessRegressor
label_desc: Use image node_id 11 for calling the BayesianOptimization obj's underlying member method code with example usage: obj.maximize(init_points, n_iter, acquisition_function, acq, kappa, kappa_decay, kappa_decay_delay, xi) without return types