mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-09 20:12:38 +02:00
37 lines
1.2 KiB
Python
37 lines
1.2 KiB
Python
# Copyright (c) 2012 - 2014 the GPy Austhors (see AUTHORS.txt)
|
|
# Licensed under the BSD 3-clause license (see LICENSE.txt)
|
|
|
|
import numpy as np
|
|
from ..core import GP
|
|
from .. import likelihoods
|
|
from .. import kern
|
|
|
|
class GPRegression(GP):
|
|
"""
|
|
Gaussian Process model for regression
|
|
|
|
This is a thin wrapper around the models.GP class, with a set of sensible defaults
|
|
|
|
:param X: input observations
|
|
:param Y: observed values
|
|
:param kernel: a GPy kernel, defaults to rbf
|
|
:param Norm normalizer: [False]
|
|
:param noise_var: the noise variance for Gaussian likelhood, defaults to 1.
|
|
|
|
Normalize Y with the norm given.
|
|
If normalizer is False, no normalization will be done
|
|
If it is None, we use GaussianNorm(alization)
|
|
|
|
.. Note:: Multiple independent outputs are allowed using columns of Y
|
|
|
|
"""
|
|
|
|
def __init__(self, X, Y, kernel=None, Y_metadata=None, normalizer=None, noise_var=1.):
|
|
|
|
if kernel is None:
|
|
kernel = kern.RBF(X.shape[1])
|
|
|
|
likelihood = likelihoods.Gaussian(variance=noise_var)
|
|
|
|
super(GPRegression, self).__init__(X, Y, kernel, likelihood, name='GP regression', Y_metadata=Y_metadata, normalizer=normalizer)
|
|
|