mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-08 19:42:39 +02:00
added mean function into the prediction
This commit is contained in:
parent
2d312099c0
commit
e97b6e59aa
1 changed files with 5 additions and 0 deletions
|
|
@ -5,6 +5,7 @@ import numpy as np
|
||||||
import sys
|
import sys
|
||||||
from .. import kern
|
from .. import kern
|
||||||
from model import Model
|
from model import Model
|
||||||
|
from mapping import Mapping
|
||||||
from parameterization import ObsAr
|
from parameterization import ObsAr
|
||||||
from .. import likelihoods
|
from .. import likelihoods
|
||||||
from ..inference.latent_function_inference import exact_gaussian_inference, expectation_propagation
|
from ..inference.latent_function_inference import exact_gaussian_inference, expectation_propagation
|
||||||
|
|
@ -201,6 +202,10 @@ class GP(Model):
|
||||||
|
|
||||||
#force mu to be a column vector
|
#force mu to be a column vector
|
||||||
if len(mu.shape)==1: mu = mu[:,None]
|
if len(mu.shape)==1: mu = mu[:,None]
|
||||||
|
|
||||||
|
#add the mean function in
|
||||||
|
if not self.mean_function is None:
|
||||||
|
mu += self.mean_function.f(_Xnew)
|
||||||
return mu, var
|
return mu, var
|
||||||
|
|
||||||
def predict(self, Xnew, full_cov=False, Y_metadata=None, kern=None):
|
def predict(self, Xnew, full_cov=False, Y_metadata=None, kern=None):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue