class_docstr: Bayesian Optimiser using `GPyOpt` as a backend.
class_docstr_tok: ["Bayesian","Optimiser","using","`","GPyOpt","`","as","a","backend","."]
docstr: Convert a sample of type :class:`Sample` to type :obj:`GPyOptSample`
  and vice versa.
  
  If the function is supplied with a :obj:`GPyOptSample` type object it
  calls the dedicated function `self._convert_from_gpyopt_sample`.
  
  Args:
      orig_sample: :class:`Sample` type object to be converted.
  
  Returns:
      A :obj:`GPyOptSample` type object with the same values as
      `orig_sample`.
docstr_tok: ["Convert","a","sample","of","type",":","class",":","`","Sample","`","to","type",":","obj",":","`","GPyOptSample","`","and","vice","versa",".","If","the","function","is","supplied","with","a",":","obj",":","`","GPyOptSample","`","type","object","it","calls","the","dedicated","function","`","self._convert_from_gpyopt_sample","`",".","Args",":","orig_sample",":",":","class",":","`","Sample","`","type","object","to","be","converted",".","Returns",":","A",":","obj",":","`","GPyOptSample","`","type","object","with","the","same","values","as","`","orig_sample","`","."]
code: def _convert_to_gpyopt_sample(
      self, orig_sample: Sample
  ) -> GPyOptSample:
      """Convert a sample of type :class:`Sample` to type :obj:`GPyOptSample`
      and vice versa.
  
      If the function is supplied with a :obj:`GPyOptSample` type object it
      calls the dedicated function `self._convert_from_gpyopt_sample`.
  
      Args:
          orig_sample: :class:`Sample` type object to be converted.
  
      Returns:
          A :obj:`GPyOptSample` type object with the same values as
          `orig_sample`.
      """
      gpyopt_sample = []
      # iterate in the order of the GPyOpt domain names
      for dim in self.gpyopt_domain:
          keys = utils.split_string(dim["name"])
          val = orig_sample[keys]
          if dim["type"] == BayesianOptimisation.CATEGORICAL_TYPE:
              val = self._categorical_value_mapper[dim["name"]][val]
          gpyopt_sample.append(val)
      return np.asarray(gpyopt_sample)
  
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 3 for calling the BayesianOptimisation obj's underlying member method code with example usage: obj._convert_to_gpyopt_sample(orig_sample) and returns: np