class_docstr: .. include:: /global.rst
  
  Please refer to |gridsearch| for more information about this algorithm.
  
  Exhaustive search over the Cartesian product of parameter tuples.
  Returns x (the tuple which maximizes f) and its score f(x).
  
  >>> s = GridSearch(x=[1,2,3], y=[-1,0,1])
  >>> best_pars, _ = s.optimize(lambda x, y: x*y)
  >>> best_pars['x']
  3
  >>> best_pars['y']
  1
class_docstr_tok: ["..","include",":",":","\/global.rst","Please","refer","to","|gridsearch|","for","more","information","about","this","algorithm",".","Exhaustive","search","over","the","Cartesian","product","of","parameter","tuples",".","Returns","x","(","the","tuple","which","maximizes","f",")","and","its","score","f","(","x",")",".",">",">",">","s","=","GridSearch","(","x=","[","1,2,3","]",",","y=","[","-1,0,1","]",")",">",">",">","best_pars",",","_","=","s.optimize","(","lambda","x",",","y",":","x","*","y",")",">",">",">","best_pars","[","'","x","'","]","3",">",">",">","best_pars","[","'","y","'","]","1"]
docstr: Initializes the solver with a tuple indicating parameter values.
  
  >>> s = GridSearch(x=[1,2], y=[3,4])
  >>> s.parameter_tuples['x']
  [1, 2]
  >>> s.parameter_tuples['y']
  [3, 4]
docstr_tok: ["Initializes","the","solver","with","a","tuple","indicating","parameter","values",".",">",">",">","s","=","GridSearch","(","x=","[","1,2","]",",","y=","[","3,4","]",")",">",">",">","s.parameter_tuples","[","'","x","'","]","[","1",",","2","]",">",">",">","s.parameter_tuples","[","'","y","'","]","[","3",",","4","]"]
code: def __init__(self, **kwargs):
      """Initializes the solver with a tuple indicating parameter values.
  
      >>> s = GridSearch(x=[1,2], y=[3,4])
      >>> s.parameter_tuples['x']
      [1, 2]
      >>> s.parameter_tuples['y']
      [3, 4]
  
      """
      self._parameter_tuples = kwargs
  
file_path: optunity/wrappers/R/inst/optunity/solvers/GridSearch.py
imports: import operator
  import itertools
  from ..functions import static_key_order
  from .solver_registry import register_solver
  from .util import Solver, _copydoc, shrink_bounds
  from .None import util
label_desc: Use image node_id 1 to create a new GridSearch object from inherited base classes: Solver with example: obj = GridSearch()