class_docstr: .. include:: /global.rst
  
  This solver implements the Tree-structured Parzen Estimator, as described in [TPE2011]_.
  This solver uses Hyperopt in the back-end and exposes the TPE estimator with uniform priors.
  
  Please refer to |tpe| for details about this algorithm.
  
  .. [TPE2011] Bergstra, James S., et al. "Algorithms for hyper-parameter optimization." Advances in Neural Information Processing Systems. 2011
code: def optimize(self, f, maximize=True, pmap=map):
      if maximize:
  
          def obj(args):
              kwargs = dict(
                  [(k, v) for k, v in zip(self.bounds.keys(), args)]
              )
              return -f(**kwargs)
  
      else:
  
          def obj(args):
              kwargs = dict(
                  [(k, v) for k, v in zip(self.bounds.keys(), args)]
              )
              return f(**kwargs)
  
      seed = self.seed if self.seed else random.randint(0, 9999999999)
      algo = functools.partial(hyperopt.tpe.suggest, seed=seed)
  
      space = [
          hyperopt.hp.uniform(k, v[0], v[1])
          for k, v in self.bounds.items()
      ]
      best = hyperopt.fmin(
          obj, space=space, algo=algo, max_evals=self.num_evals
      )
      return best, None
  
file_path: optunity/wrappers/R/inst/optunity/solvers/TPE.py
imports: from .solver_registry import register_solver
  from .util import Solver, _copydoc
  import functools
  import random
label_desc: Use image node_id 6 for calling the TPE obj's underlying member method code with example usage: obj.optimize(f, maximize, pmap) and returns: best,  None, unknown, f