class_docstr: .. include:: /global.rst
  
  Please refer to |cmaes| for details about this algorithm.
  
  This solver uses an implementation available in the DEAP library [DEAP2012]_.
  
  .. warning:: This solver has dependencies on DEAP_ and NumPy_
      and will be unavailable if these are not met.
  
      .. _DEAP: https://code.google.com/p/deap/
      .. _NumPy: http://www.numpy.org
class_docstr_tok: ["..","include",":",":","\/global.rst","Please","refer","to","|cmaes|","for","details","about","this","algorithm",".","This","solver","uses","an","implementation","available","in","the","DEAP","library","[","DEAP2012","]","_",".","..","warning",":",":","This","solver","has","dependencies","on","DEAP_","and","NumPy_","and","will","be","unavailable","if","these","are","not","met",".","..","_DEAP",":","https",":","\/\/code.google.com\/p\/deap\/","..","_NumPy",":","http",":","\/\/www.numpy.org"]
code: def optimize(self, f, maximize=True, pmap=map):
      toolbox = deap.base.Toolbox()
      if maximize:
          fit = 1.0
      else:
          fit = -1.0
      deap.creator.create(
          "FitnessMax", deap.base.Fitness, weights=(fit,)
      )
      Fit = deap.creator.FitnessMax
      deap.creator.create("Individual", list, fitness=Fit)
      Individual = deap.creator.Individual
  
      if self.lambda_:
          strategy = deap.cma.Strategy(
              centroid=list(self.start.values()),
              sigma=self.sigma,
              lambda_=self.lambda_,
          )
      else:
          strategy = deap.cma.Strategy(
              centroid=list(self.start.values()), sigma=self.sigma
          )
      toolbox.register("generate", strategy.generate, Individual)
      toolbox.register("update", strategy.update)
  
      @functools.wraps(f)
      def evaluate(individual):
          return (
              util.score(
                  f(
                      **dict(
                          [
                              (k, v)
                              for k, v in zip(
                                  self.start.keys(), individual
                              )
                          ]
                      )
                  )
              ),
          )
  
      toolbox.register("evaluate", evaluate)
      toolbox.register("map", pmap)
  
      hof = deap.tools.HallOfFame(1)
      deap.algorithms.eaGenerateUpdate(
          toolbox=toolbox,
          ngen=self._num_generations,
          halloffame=hof,
          verbose=False,
      )
  
      return (
          dict([(k, v) for k, v in zip(self.start.keys(), hof[0])]),
          None,
      )
  
file_path: optunity/wrappers/R/inst/optunity/solvers/CMAES.py
imports: import math
  import functools
  from .solver_registry import register_solver
  from .util import Solver, _copydoc
  from .None import util
label_desc: Use image node_id 7 for calling the CMA_ES obj's underlying member method code with example usage: obj.optimize(f, maximize, pmap) and returns: dict,  None, util