class_docstr: .. include:: /global.rst
  
  This solver provides an interface to BayesOpt, as described in [BO2014]_.
  This solver uses BayesOpt in the back-end and exposes its solver with uniform priors.
  
  Please refer to |bayesopt| for details about this algorithm.
  
  .. note::
  
      This solver will always output some text upon running.
      This is caused internally by BayesOpt, which provides no way to disable all output.
  
  .. [BO2014] Martinez-Cantin, Ruben. "BayesOpt: A Bayesian optimization library for nonlinear optimization, experimental design and bandits." The Journal of Machine Learning Research 15.1 (2014): 3735-3739.
class_docstr_tok: ["..","include",":",":","\/global.rst","This","solver","provides","an","interface","to","BayesOpt",",","as","described","in","[","BO2014","]","_",".","This","solver","uses","BayesOpt","in","the","back-end","and","exposes","its","solver","with","uniform","priors",".","Please","refer","to","|bayesopt|","for","details","about","this","algorithm",".","..","note",":",":","This","solver","will","always","output","some","text","upon","running",".","This","is","caused","internally","by","BayesOpt",",","which","provides","no","way","to","disable","all","output",".","..","[","BO2014","]","Martinez-Cantin",",","Ruben",".","``","BayesOpt",":","A","Bayesian","optimization","library","for","nonlinear","optimization",",","experimental","design","and","bandits",".","''","The","Journal","of","Machine","Learning","Research","15.1","(","2014",")",":","3735-3739","."]
code: def optimize(self, f, maximize=True, pmap=map):
      seed = self.seed if self.seed else random.randint(0, 9999)
      params = {
          "n_iterations": self.num_evals,
          "random_seed": seed,
          "n_iter_relearn": 3,
          "verbose_level": 0,
      }
      n_dimensions = len(self.lb)
  
      print("lb %s" % str(self.lb))
      print("ub %s" % str(self.ub))
  
      if maximize:
  
          def obj(args):
              kwargs = dict(
                  [
                      (k, v)
                      for k, v in zip(sorted(self.bounds.keys()), args)
                  ]
              )
              return -f(**kwargs)
  
      else:
  
          def obj(args):
              kwargs = dict(
                  [
                      (k, v)
                      for k, v in zip(sorted(self.bounds.keys()), args)
                  ]
              )
              return f(**kwargs)
  
      mvalue, x_out, error = bayesopt.optimize(
          obj, n_dimensions, self.lb, self.ub, params
      )
      best = dict(
          [(k, v) for k, v in zip(sorted(self.bounds.keys()), x_out)]
      )
      return best, None
  
file_path: optunity/optunity/solvers/BayesOpt.py
imports: from .solver_registry import register_solver
  from .util import Solver, _copydoc
  import functools
  import random
label_desc: Use image node_id 8 for calling the BayesOpt obj's underlying member method code with example usage: obj.optimize(f, maximize, pmap) and returns: best,  None, unknown, f