class_docstr: Class for fitting Gaussian processes. 
class_docstr_tok: ["Class","for","fitting","Gaussian","processes","."]
docstr: A method which builds a GP from the given gp_hyperparameters. It calls
  _child_build_gp after running some checks. 
docstr_tok: ["A","method","which","builds","a","GP","from","the","given","gp_hyperparameters",".","It","calls","_child_build_gp","after","running","some","checks","."]
code: def build_gp(
      self,
      gp_cts_hps,
      gp_dscr_hps,
      other_gp_params=None,
      *args,
      **kwargs,
  ):
      """A method which builds a GP from the given gp_hyperparameters. It calls
      _child_build_gp after running some checks."""
      # pylint: disable=too-many-branches
      # Check the length of the hyper-parameters
      if self.num_hps != len(gp_cts_hps) + len(gp_dscr_hps):
          raise ValueError(
              "gp_hyperparams should be of length %d. Given length: %d."
              % (self.num_hps, len(gp_cts_hps) + len(gp_dscr_hps))
          )
      # Compute the mean and the noise variance first
      # Mean function -------------------------------------
      if (
          hasattr(self.options, "mean_func")
          and self.options.mean_func is not None
      ):
          mean_func = self.options.mean_func
      else:
          if self.options.mean_func_type == "mean":
              mean_func_const_value = np.mean(self.Y)
          elif self.options.mean_func_type == "median":
              mean_func_const_value = np.median(self.Y)
          elif self.options.mean_func_type == "upper_bound":
              mean_func_const_value = np.mean(self.Y) + 3 * np.std(
                  self.Y
              )
          elif self.options.mean_func_type == "const":
              mean_func_const_value = self.options.mean_func_const
          elif self.options.mean_func_type == "tune":
              mean_func_const_value = gp_cts_hps[0].item()
              gp_cts_hps = gp_cts_hps[1:]
          else:
              mean_func_const_value = 0
  
          def _get_mean_func(_mean_func_const_value):
              """Returns the mean function from the constant value."""
              return lambda x: np.array(
                  [_mean_func_const_value] * len(x)
              )
  
          mean_func = _get_mean_func(mean_func_const_value)
      # Noise variance ------------------------------------
      if self.options.noise_var_type == "tune":
          noise_var = np.exp(gp_cts_hps[0])
          gp_cts_hps = gp_cts_hps[1:]
      elif self.options.noise_var_type == "label":
          noise_var = self.options.noise_var_label * (self.Y.std() ** 2)
      else:
          noise_var = self.options.noise_var_value
      ret_gp, ret_cts_hps, ret_dscr_hps = self._child_build_gp(
          mean_func,
          noise_var,
          gp_cts_hps,
          gp_dscr_hps,
          other_gp_params=other_gp_params,
          *args,
          **kwargs,
      )
      assert len(ret_cts_hps) == 0
      assert len(ret_dscr_hps) == 0
      return ret_gp
  
imports: from __future__ import division
  from argparse import Namespace
  from itertools import product
  import sys
  import numpy
  from ..distributions.model import Model
  from ..distributions import continuous
  from ..distributions import discrete
  from ..utils.general_utils import stable_cholesky, draw_gaussian_samples, project_symmetric_to_psd_cone, solve_lower_triangular, solve_upper_triangular
  from ..utils.oper_utils import direct_ft_maximise, pdoo_maximise, random_maximise, random_sample_cts_dscr
  from ..utils.option_handler import get_option_specs, load_options
  from ..utils.reporters import get_reporter
label_desc: Use image node_id 10 for calling the GPFitter obj's underlying member method code with example usage: obj.build_gp(gp_cts_hps, gp_dscr_hps, other_gp_params) and returns: ret_gp, function