A Gaussian process is defined by its mean and covariance functions and respectivily
and Gaussian Process (GP) can be written as
The free parameters in the covariance functions are called hyperparameters.
When doing regression we are interested in finding the model outputs for a given set of inputs, and the confidence of the predictions. We have training dataset
For simplicity we have set , , and .
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
|