class_docstr: Bayesian Optimiser using `GPyOpt` as a backend.
class_docstr_tok: ["Bayesian","Optimiser","using","`","GPyOpt","`","as","a","backend","."]
code: def _convert_evaluation_sample(self, x, fx):
      if isinstance(fx, (float, int)):
          array_fx = np.array([[fx]])
      elif isinstance(fx, EvaluationScore):
          array_fx = np.array([[fx.value]])
      elif isinstance(fx, Dict):
          if not len(fx) == 1:
              raise NotImplementedError(
                  "Currently only evaluations with a single metric are supported."
              )
          array_fx = np.array([[list(fx.values())[0].value]])
      else:
          raise TypeError(
              "Cannot update history for one sample and multiple evaluations."
              " Use batched update instead and provide a list of samples and "
              "a list of evaluation metrics."
          )
      converted_x = self._convert_to_gpyopt_sample(x).reshape(1, -1)
      return converted_x, array_fx
  
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 8 for calling the BayesianOptimisation obj's underlying member method code with example usage: obj._convert_evaluation_sample(x, fx) and returns: converted_x,  array_fx