class_docstr: Holds the param-space coordinates (X) and target values (Y)
  Allows for constant-time appends while ensuring no duplicates are added
  
  Example
  -------
  >>> def target_func(p1, p2):
  >>>     return p1 + p2
  >>> pbounds = {'p1': (0, 1), 'p2': (1, 100)}
  >>> space = TargetSpace(target_func, pbounds, random_state=0)
  >>> x = np.array([4 , 5])
  >>> y = target_func(x)
  >>> space.register(x, y)
  >>> assert self.max()['target'] == 9
  >>> assert self.max()['params'] == {'p1': 1.0, 'p2': 2.0}
class_docstr_tok: ["Holds","the","param-space","coordinates","(","X",")","and","target","values","(","Y",")","Allows","for","constant-time","appends","while","ensuring","no","duplicates","are","added","Example","--","--","--","-",">",">",">","def","target_func","(","p1",",","p2",")",":",">",">",">","return","p1","+","p2",">",">",">","pbounds","=","{","'p1","'",":","(","0",",","1",")",",","'p2","'",":","(","1",",","100",")","}",">",">",">","space","=","TargetSpace","(","target_func",",","pbounds",",","random_state=0",")",">",">",">","x","=","np.array","(","[","4",",","5","]",")",">",">",">","y","=","target_func","(","x",")",">",">",">","space.register","(","x",",","y",")",">",">",">","assert","self.max","(",")","[","'target","'","]","==","9",">",">",">","assert","self.max","(",")","[","'params","'","]","==","{","'p1","'",":","1.0",",","'p2","'",":","2.0","}"]
docstr: Evaluates a single point x, to obtain the value y and then registers the
  point and its evaluation.
  
  Notes
  -----
  If x has been previously seen returns a cached value of y.
  
  Parameters
  ----------
  x : ndarray
      a single point, with len(x) == self.dim
  
  Returns
  -------
  y : float
      target function value.
  
  Example
  -------
  >>> target_func = lambda p1, p2: p1 + p2
  >>> pbounds = {'p1': (0, 1), 'p2': (1, 100)}
  >>> space = TargetSpace(target_func, pbounds)
  >>> space.probe([1, 5])
  >>> assert self.max()['target'] == 6
  >>> assert self.max()['params'] == {'p1': 1.0, 'p2': 5.0}
docstr_tok: ["Evaluates","a","single","point","x",",","to","obtain","the","value","y","and","then","registers","the","point","and","its","evaluation",".","Notes","--","--","-","If","x","has","been","previously","seen","returns","a","cached","value","of","y.","Parameters","--","--","--","--","--","x",":","ndarray","a","single","point",",","with","len","(","x",")","==","self.dim","Returns","--","--","--","-","y",":","float","target","function","value",".","Example","--","--","--","-",">",">",">","target_func","=","lambda","p1",",","p2",":","p1","+","p2",">",">",">","pbounds","=","{","'p1","'",":","(","0",",","1",")",",","'p2","'",":","(","1",",","100",")","}",">",">",">","space","=","TargetSpace","(","target_func",",","pbounds",")",">",">",">","space.probe","(","[","1",",","5","]",")",">",">",">","assert","self.max","(",")","[","'target","'","]","==","6",">",">",">","assert","self.max","(",")","[","'params","'","]","==","{","'p1","'",":","1.0",",","'p2","'",":","5.0","}"]
code: def probe(self, params):
      """
      Evaluates a single point x, to obtain the value y and then registers the
      point and its evaluation.
  
      Notes
      -----
      If x has been previously seen returns a cached value of y.
  
      Parameters
      ----------
      x : ndarray
          a single point, with len(x) == self.dim
  
      Returns
      -------
      y : float
          target function value.
  
      Example
      -------
      >>> target_func = lambda p1, p2: p1 + p2
      >>> pbounds = {'p1': (0, 1), 'p2': (1, 100)}
      >>> space = TargetSpace(target_func, pbounds)
      >>> space.probe([1, 5])
      >>> assert self.max()['target'] == 6
      >>> assert self.max()['params'] == {'p1': 1.0, 'p2': 5.0}
      """
      x = self._as_array(params)
      params = dict(zip(self._keys, x))
      target = self.target_func(**params)
  
      if self._constraint is None:
          self.register(x, target)
          return target
      else:
          constraint_value = self._constraint.eval(**params)
          self.register(x, target, constraint_value)
          return target, constraint_value
  
imports: import numpy
  from warnings import warn
  from .util import ensure_rng, NotUniqueError
  from .util import Colours
label_desc: Use image node_id 17 for calling the TargetSpace obj's underlying member method code with example usage: obj.probe(params) and returns: target, target,  constraint_value