bayeso.utils.utils_gp

It is utilities for Gaussian process regression.

bayeso.utils.utils_gp.check_str_cov(str_fun: str, str_cov: str, shape_X1: tuple, shape_X2: tuple = None) → None

It is for validating the shape of X1 (and optionally the shape of X2).

Parameters:
  • str_fun (str.) – the name of function.
  • str_cov (str.) – the name of covariance function.
  • shape_X1 (tuple) – the shape of X1.
  • shape_X2 (NoneType or tuple, optional) – None, or the shape of X2.
Returns:

None, if it is valid. Raise an error, otherwise.

Return type:

NoneType

Raises:

AssertionError, ValueError

bayeso.utils.utils_gp.get_prior_mu(prior_mu: Optional[callable], X: numpy.ndarray) → numpy.ndarray

It computes the prior mean function values over inputs X.

Parameters:
  • prior_mu (function or NoneType) – prior mean function or None.
  • X (numpy.ndarray) – inputs for prior mean function. Shape: (n, d) or (n, m, d).
Returns:

zero array, or array of prior mean function values. Shape: (n, 1).

Return type:

numpy.ndarray

Raises:

AssertionError