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: Get the maximum target value within the current parameter bounds,
  and its associated parameters. 
  
  If there is a constraint present, the maximum value that fulfills the
  constraint within the parameter bounds is returned.
  
  Returns
  ----------
  res: dict
      A dictionary with the keys 'target' and 'params'. The value of
      'target' is the maximum target value, and the value of 'params' is
      a dictionary with the parameter names as keys and the parameter
      values as values.
docstr_tok: ["Get","the","maximum","target","value","within","the","current","parameter","bounds",",","and","its","associated","parameters",".","If","there","is","a","constraint","present",",","the","maximum","value","that","fulfills","the","constraint","within","the","parameter","bounds","is","returned",".","Returns","--","--","--","--","--","res",":","dict","A","dictionary","with","the","keys","'target","'","and","'params","'",".","The","value","of","'target","'","is","the","maximum","target","value",",","and","the","value","of","'params","'","is","a","dictionary","with","the","parameter","names","as","keys","and","the","parameter","values","as","values","."]
code: def max(self):
      """Get the maximum target value within the current parameter bounds,
      and its associated parameters.
  
      If there is a constraint present, the maximum value that fulfills the
      constraint within the parameter bounds is returned.
  
      Returns
      ----------
      res: dict
          A dictionary with the keys 'target' and 'params'. The value of
          'target' is the maximum target value, and the value of 'params' is
          a dictionary with the parameter names as keys and the parameter
          values as values.
  
      """
      target_max = self._target_max()
      if target_max is None:
          return None
  
      target = self.target[self.mask]
      params = self.params[self.mask]
      target_max_idx = np.argmax(target)
  
      res = {
          "target": target_max,
          "params": dict(zip(self.keys, params[target_max_idx])),
      }
  
      if self._constraint is not None:
          constraint_values = self.constraint_values[self.mask]
          res["constraint"] = constraint_values[target_max_idx]
  
      return res
  
imports: import numpy
  from warnings import warn
  from .util import ensure_rng, NotUniqueError
  from .util import Colours
label_desc: Use image node_id 20 for calling the TargetSpace obj's underlying member method code with example usage: obj.max() and returns: res, None