A python library for Gaussian Process Regression.
-
Import GPlib to use it in your python script.
import gplib
-
Initialize the GP with the desired modules.
gp = gplib.GP(
mean_function=gplib.mea.Fixed(),
covariance_function=gplib.ker.SquaredExponential()
)
-
Plot the GP.
gplib.plot.gp_1d(gp, n_samples=10)
-
Generate some random data.
import numpy as np
data = {
'X': np.arange(3, 8, 1.0)[:, None],
'Y': np.random.uniform(0, 2, 5)[:, None]
}
-
Get the posterior GP given the data.
posterior_gp = gp.get_posterior(data)
-
Finally plot the posterior GP.
gplib.plot.gp_1d(posterior_gp, data, n_samples=10)
-
There are more examples in examples/ directory. Check them out!