class_docstr: .. include:: /global.rst
  
  Please refer to |nelder-mead| for details about this algorithm.
  
  >>> s = NelderMead(x=1, y=1, xtol=1e-8) #doctest:+SKIP
  >>> best_pars, _ = s.optimize(lambda x, y: -x**2 - y**2) #doctest:+SKIP
  >>> [math.fabs(best_pars['x']) < 1e-8, math.fabs(best_pars['y']) < 1e-8]  #doctest:+SKIP
  [True, True]
class_docstr_tok: ["..","include",":",":","\/global.rst","Please","refer","to","|nelder-mead|","for","details","about","this","algorithm",".",">",">",">","s","=","NelderMead","(","x=1",",","y=1",",","xtol=1e-8",")","#","doctest",":","+SKIP",">",">",">","best_pars",",","_","=","s.optimize","(","lambda","x",",","y",":","-x","*","*","2","-","y","*","*","2",")","#","doctest",":","+SKIP",">",">",">","[","math.fabs","(","best_pars","[","'","x","'","]",")","<","1e-8",",","math.fabs","(","best_pars","[","'","y","'","]",")","<","1e-8","]","#","doctest",":","+SKIP","[","True",",","True","]"]
code: def optimize(self, f, maximize=True, pmap=map):
      if maximize:
          f = fun.negated(f)
  
      sortedkeys = sorted(self.start.keys())
      x0 = [float(self.start[k]) for k in sortedkeys]
  
      f = fun.static_key_order(sortedkeys)(f)
  
      def func(x):
          return util.score(f(*x))
  
      xopt = self._solve(func, x0)
      return dict([(k, v) for k, v in zip(sortedkeys, xopt)]), None
  
file_path: optunity/wrappers/R/inst/optunity/solvers/NelderMead.py
imports: import array
  import operator
  from ..None import functions
  from .solver_registry import register_solver
  from .util import Solver, _copydoc
  from .None import util
label_desc: Use image node_id 6 for calling the NelderMead obj's underlying member method code with example usage: obj.optimize(f, maximize, pmap) and returns: dict,  None, util