Gaussian Processes for regression.
Gaussian Process class.
Methods
find_likelihood_der | |
fit_data | |
generate | |
regression |
Find the negative log likelihood and its partial derivatives.
Fit the hyper-parameters to the data.
X Input samples (2d array, samples row-wise) y Function output (1d array)
Generate samples from the GP.
Parameters : | x : np array
rn : np array
|
---|
Predict the y values for XX given the X, y, and the objects covariance function.
Parameters : | X : MxD np array
y : 1-dimensional np array of length M
XX : NxD np array
max_samples : int, optional
|
---|---|
Returns : | ys : np array of length N
s2 : np array of length N
|
Bases: object
Gaussian Process for regression.
Methods
df | |
f | |
find_hyperparameters | |
predict |
The partial derivatives of the function to minimize, which is the likihood in this case. This method is passed to the optimizer.
Parameters : | params : 1D np array, optional
|
---|---|
Returns : | der : np array
|
The function to minimize, which is the likihood in this case. This method is passed to the optimizer.
Parameters : | params : 1D np array, optional
|
---|---|
Returns : | nllikelihood : float
|
Find hyperparameters for the GP.
Predict the the output of the GPR for the inputs given in XX
Parameters : | XX : NxD np array
|
---|---|
Returns : | res : np array
|
Gaussian Process class.
Methods
find_likelihood_der | |
fit_data | |
generate | |
regression |
Find the negative log likelihood and its partial derivatives.
Fit the hyper-parameters to the data.
X Input samples (2d array, samples row-wise) y Function output (1d array)
Generate samples from the GP.
Parameters : | x : np array
rn : np array
|
---|
Predict the y values for XX given the X, y, and the objects covariance function.
Parameters : | X : MxD np array
y : 1-dimensional np array of length M
XX : NxD np array
max_samples : int, optional
|
---|---|
Returns : | ys : np array of length N
s2 : np array of length N
|
Bases: object
The base covariance function class. When creating a new covariance function, you should inherit this class.
Methods
clear_temp | |
derivative | |
eval | |
get_params | |
set_params |
This method clears all temporary variables used by the covariance functions. Should be called after finishing using the function, for example training.
Evaluate a partial derivative of the covariance function.
Parameters : | x : NxD np array
param_no : int
|
---|---|
Returns : | der : NxN np array
|
Calculate the covariance matrix.
Parameters : | x : NxD np array
xs : MxD np array, optional
|
---|---|
Returns : | cov : NxN np array or a tuple
If `xs` is None, then the covariance matrix is returned. The matrix : `x` is an (N x D) matrix, where there are N samples, and D : dimensions. The returned matrix (array) will be a (N x N) matrix. : `xs` is used to specify a test set. If xs (M x D) is set, a tuple : (Kssdiag, Ks) is returned. Kssdiag is a column vector with m self : covariances of the test set. Ks is a (N x M) matrix containing the : cross variance between the training and test data. : |
Get the hyper-parameters.
Returns : | hp : list
|
---|
Set hyperparameters to the values given.
Parameters: log_parameters : list
Set the hyperparameters. The order of the list is important. The covariance functions’ hyperparameters are set from left to right.
Bases: pypr.gp.covar_funcs.cfCovarianceFunction
Constant jitter, similar to noise, but cannot be changed. This can make the regression calculation better conditioned.
Methods
clear_temp | |
derivative | |
eval | |
get_params | |
set_params |
See help(cfCovarianceFunction.derivative)
See help(cfCovarianceFunction.eval)
Returns a list containing one element, which is the gaussian noise
Set the gaussian noise hyperparameter. Must be a list with one element.
Bases: pypr.gp.covar_funcs.cfCovarianceFunction
White noise.
Methods
clear_temp | |
derivative | |
eval | |
get_params | |
set_params |
See help(cfCovarianceFunction.derivative)
See help(cfCovarianceFunction.eval)
Get white noise hyperparameter
Returns : | log_hyperparameter : list
|
---|
Set the white noise hyperparameter.
Parameters : | log_parameters : list
|
---|
Bases: pypr.gp.covar_funcs.cfCovarianceFunction
The Squared Exponential covariance function with Automatic Relevance Determination (ARD).
Methods
clear_temp | |
derivative | |
eval | |
get_params | |
set_params |
This method clears all temporary variables used by the covariance function.
See help(cfCovarianceFunction.derivative)
See help(cfCovarianceFunction.eval)
Get hyperparameters.
Returns : | hyperparameters : list
|
---|
Set the log of the hyperparameters
Parameters : | log_parameters : list
|
---|
Bases: pypr.gp.covar_funcs.cfCovarianceFunction
The isotropic Squared Exponential covariance function.
Methods
clear_temp | |
derivative | |
eval | |
get_params | |
set_params |
See help(cfCovarianceFunction.derivative)
See help(cfCovarianceFunction.eval)
Returns a list of the log of the hyperparameters.
Returns : | log_hyperparameters : list
|
---|
Set the log of the hyperparameters to log_parameters.
Parameters : | log_parameters : list
|
---|
Bases: pypr.gp.covar_funcs.cfCovarianceFunction
The purpose of this class is to represent an addition of two covariance functions.
Methods
clear_temp | |
derivative | |
eval | |
get_params | |
set_params |
This method clears all temporary variables used by both the covariance functions in the sum.
See help(cfCovarianceFunction.derivative)
See help(cfCovarianceFunction.eval)
Returns a list of the log of the hyperparameters.
Set the log of the hyperparameters to log_parameters. The parameters in the left hand side covariance function are set to first part of the list, the right hand side covariance function to the rest.
Bases: unittest.TestCase
Gaussian Processes for regression.
Plot the mean predicted values and 95% confidence interval, two times the standard error, as a shaded area.
Parameters : | xs: array :
ys: array :
s2: array :
line_setting: dictionary, optional :
shade_setting: dictionary, optional :
axes: axes, optional :
|
---|---|
Returns : | Returns a tuple with : line: matplotlib.lines.Line2D :
poly: matplotlib.collections.PolyCollection :
|