class_docstr: Bayesian Optimiser using `GPyOpt` as a backend.
class_docstr_tok: ["Bayesian","Optimiser","using","`","GPyOpt","`","as","a","backend","."]
docstr: Update the surrogate model with the domain sample `x` and the
  function evaluation `fx`.
  
  Args:
      x: class:`Sample`. One sample of the domain of the objective
          function.
      fx: a :obj:`float`, an :class:`EvaluationScore` or a :obj:`dict`.
          The evaluation scores of the objective evaluated at `x`. If
          given as :obj:`dict` then it must be a mapping from metric names
          to :class:`EvaluationScore` or :obj:`float` results.
      **kwargs: unused by this model.
docstr_tok: ["Update","the","surrogate","model","with","the","domain","sample","`","x","`","and","the","function","evaluation","`","fx","`",".","Args",":","x",":","class",":","`","Sample","`",".","One","sample","of","the","domain","of","the","objective","function",".","fx",":","a",":","obj",":","`","float","`",",","an",":","class",":","`","EvaluationScore","`","or","a",":","obj",":","`","dict","`",".","The","evaluation","scores","of","the","objective","evaluated","at","`","x","`",".","If","given","as",":","obj",":","`","dict","`","then","it","must","be","a","mapping","from","metric","names","to",":","class",":","`","EvaluationScore","`","or",":","obj",":","`","float","`","results",".","*","*","kwargs",":","unused","by","this","model","."]
code: def update(self, x, fx, **kwargs):
      """Update the surrogate model with the domain sample `x` and the
      function evaluation `fx`.
  
      Args:
          x: class:`Sample`. One sample of the domain of the objective
              function.
          fx: a :obj:`float`, an :class:`EvaluationScore` or a :obj:`dict`.
              The evaluation scores of the objective evaluated at `x`. If
              given as :obj:`dict` then it must be a mapping from metric names
              to :class:`EvaluationScore` or :obj:`float` results.
          **kwargs: unused by this model.
      """
      super(BayesianOptimisation, self).update(x, fx)
      # both `converted_x` and `array_fx` must be 2dim arrays
      if isinstance(x, Sample):
          converted_x, array_fx = self._convert_evaluation_sample(x, fx)
      elif (
          isinstance(x, Sequence)
          and isinstance(fx, Sequence)
          and len(x) == len(fx)
      ):
          # append each history point to the tracked history and
          # convert to numpy arrays
          converted_x, array_fx = map(
              np.concatenate,
              zip(
                  *[
                      self._convert_evaluation_sample(i, j)
                      for i, j in zip(x, fx)
                  ]
              ),
          )
      else:
          raise ValueError(
              "Update values for `x` and `f(x)` must be either "
              "`Sample` and an evaluation or a list thereof."
          )
  
      if self._data_x.size == 0:
          self._data_x = converted_x
          self._data_fx = array_fx
      else:
          self._data_x = np.concatenate([self._data_x, converted_x])
          self._data_fx = np.concatenate([self._data_fx, array_fx])
      self.__is_empty_data = False
  
imports: from multiprocessing import cpu_count
  from typing import Any, Dict, List, Sequence, Tuple, Type, TypeVar, Union
  import GPy
  import GPyOpt
  import numpy
  from GPyOpt.core import errors
  from hypertunity import utils
  from hypertunity.domain import Domain, Sample
  from hypertunity.optimisation.base import EvaluationScore, ExhaustedSearchSpaceError, Optimiser
label_desc: Use image node_id 7 for calling the BayesianOptimisation obj's underlying member method code with example usage: obj.update(x, fx) without return types