class_docstr: Bayesian Optimiser using `GPyOpt` as a backend.
class_docstr_tok: ["Bayesian","Optimiser","using","`","GPyOpt","`","as","a","backend","."]
docstr: Convert :obj:`GPyOptSample` type object to the corresponding
  :class:`Sample` type.
  
  Args:
      gpyopt_sample: :obj:`GPyOptSample` object to be converted.
  
  Returns:
      A :class:`Sample` type object with the same values as
          `gpyopt_sample`.
docstr_tok: ["Convert",":","obj",":","`","GPyOptSample","`","type","object","to","the","corresponding",":","class",":","`","Sample","`","type",".","Args",":","gpyopt_sample",":",":","obj",":","`","GPyOptSample","`","object","to","be","converted",".","Returns",":","A",":","class",":","`","Sample","`","type","object","with","the","same","values","as","`","gpyopt_sample","`","."]
code: def _convert_from_gpyopt_sample(
      self, gpyopt_sample: GPyOptSample
  ) -> Sample:
      """Convert :obj:`GPyOptSample` type object to the corresponding
      :class:`Sample` type.
  
      Args:
          gpyopt_sample: :obj:`GPyOptSample` object to be converted.
  
      Returns:
          A :class:`Sample` type object with the same values as
              `gpyopt_sample`.
      """
      if len(self.gpyopt_domain) != len(gpyopt_sample):
          raise ValueError(
              f"Cannot convert sample with mismatching dimensionality. "
              f"The original space has {len(self.domain)} dimensions and the "
              f"sample {len(gpyopt_sample)} dimensions."
          )
      orig_sample = {}
      for dim, value in zip(self.gpyopt_domain, gpyopt_sample):
          names = utils.split_string(dim["name"])
          sub_dim = orig_sample
          for name in names[:-1]:
              if name not in sub_dim:
                  sub_dim[name] = {}
              sub_dim = sub_dim[name]
          if dim["type"] == BayesianOptimisation.CATEGORICAL_TYPE:
              sub_dim[names[-1]] = self._inv_categorical_value_mapper[
                  dim["name"]
              ][value]
          elif dim["type"] == BayesianOptimisation.DISCRETE_TYPE:
              sub_dim[names[-1]] = self._discrete_type_mapper[
                  dim["name"]
              ][value](value)
          else:
              sub_dim[names[-1]] = value
      return Sample(orig_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 4 for calling the BayesianOptimisation obj's underlying member method code with example usage: obj._convert_from_gpyopt_sample(gpyopt_sample) and returns: Sample