pyGPGO.surrogates.tStudentProcess module

pyGPGO.surrogates.tStudentProcess.logpdf(x, df, mu, Sigma)[source]

Marginal log-likelihood of a Student-t Process

Parameters:
  • x (array-like) – Point to be evaluated
  • df (float) – Degrees of freedom (>2.0)
  • mu (array-like) – Mean of the process.
  • Sigma (array-like) – Covariance matrix of the process.
Returns:

logp – log-likelihood

Return type:

float

class pyGPGO.surrogates.tStudentProcess.tStudentProcess(covfunc, nu=3.0, optimize=False)[source]

Bases: object

t-Student Process regressor class. This class DOES NOT support gradients in ML estimation yet.

Parameters:
  • covfunc (instance from a class of covfunc module) – An instance from a class from the covfunc module.
  • nu (float) – (>2.0) Degrees of freedom
covfunc

Internal covariance function.

Type:object
nu

Degrees of freedom.

Type:float
optimize

Whether to optimize covariance function hyperparameters.

Type:bool
__init__(covfunc, nu=3.0, optimize=False)[source]

t-Student Process regressor class. This class DOES NOT support gradients in ML estimation yet.

Parameters:
  • covfunc (instance from a class of covfunc module) – An instance from a class from the covfunc module.
  • nu (float) – (>2.0) Degrees of freedom
covfunc

Internal covariance function.

Type:object
nu

Degrees of freedom.

Type:float
optimize

Whether to optimize covariance function hyperparameters.

Type:bool
_lmlik(param_vector, param_key)[source]

Returns marginal negative log-likelihood for given covariance hyperparameters.

Parameters:
  • param_vector (list) – List of values corresponding to hyperparameters to query.
  • param_key (list) – List of hyperparameter strings corresponding to param_vector.
Returns:

Negative log-marginal likelihood for chosen hyperparameters.

Return type:

float

fit(X, y)[source]

Fits a t-Student Process regressor

Parameters:
  • X (np.ndarray, shape=(nsamples, nfeatures)) – Training instances to fit the GP.
  • y (np.ndarray, shape=(nsamples,)) – Corresponding continuous target values to X.
getcovparams()[source]

Returns current covariance function hyperparameters

Returns:Dictionary containing covariance function hyperparameters
Return type:dict
optHyp(param_key, param_bounds, n_trials=5)[source]

Optimizes the negative marginal log-likelihood for given hyperparameters and bounds. This is an empirical Bayes approach (or Type II maximum-likelihood).

Parameters:
  • param_key (list) – List of hyperparameters to optimize.
  • param_bounds (list) – List containing tuples defining bounds for each hyperparameter to optimize over.
predict(Xstar, return_std=False)[source]

Returns mean and covariances for the posterior t-Student process.

Parameters:
  • Xstar (np.ndarray, shape=((nsamples, nfeatures))) – Testing instances to predict.
  • return_std (bool) – Whether to return the standard deviation of the posterior process. Otherwise, it returns the whole covariance matrix of the posterior process.
Returns:

  • np.ndarray – Mean of the posterior process for testing instances.
  • np.ndarray – Covariance of the posterior process for testing instances.

update(xnew, ynew)[source]

Updates the internal model with xnew and ynew instances.

Parameters:
  • xnew (np.ndarray, shape=((m, nfeatures))) – New training instances to update the model with.
  • ynew (np.ndarray, shape=((m,))) – New training targets to update the model with.