GPy/GPy/models/GP_regression.py

36 lines
1.2 KiB
Python
Raw Normal View History

# Copyright (c) 2012, James Hensman
# Licensed under the BSD 3-clause license (see LICENSE.txt)
2012-11-29 16:32:48 +00:00
import numpy as np
from ..core import GP
from .. import likelihoods
2012-11-29 16:32:48 +00:00
from .. import kern
class GP_regression(GP):
2012-11-29 16:32:48 +00:00
"""
Gaussian Process model for regression
This is a thin wrapper around the models.GP class, with a set of sensible defalts
2012-11-29 16:32:48 +00:00
:param X: input observations
:param Y: observed values
:param kernel: a GPy kernel, defaults to rbf
2012-11-29 16:32:48 +00:00
:param normalize_X: whether to normalize the input data before computing (predictions will be in original scales)
:type normalize_X: False|True
:param normalize_Y: whether to normalize the input data before computing (predictions will be in original scales)
:type normalize_Y: False|True
.. Note:: Multiple independent outputs are allowed using columns of Y
"""
def __init__(self,X,Y,kernel=None,normalize_X=False,normalize_Y=False):
2012-11-29 16:32:48 +00:00
if kernel is None:
kernel = kern.rbf(X.shape[1])
2012-11-29 16:32:48 +00:00
likelihood = likelihoods.Gaussian(Y,normalize=normalize_Y)
2012-11-29 16:32:48 +00:00
2013-06-04 17:19:33 +01:00
GP.__init__(self, X, likelihood, kernel, normalize_X=normalize_X)
self._set_params(self._get_params())