From e97b6e59aab6243e8440475078ef0300eaae8639 Mon Sep 17 00:00:00 2001 From: James Hensman Date: Mon, 23 Mar 2015 14:59:08 +0000 Subject: [PATCH] added mean function into the prediction --- GPy/core/gp.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/GPy/core/gp.py b/GPy/core/gp.py index 732db7e2..d415d995 100644 --- a/GPy/core/gp.py +++ b/GPy/core/gp.py @@ -5,6 +5,7 @@ import numpy as np import sys from .. import kern from model import Model +from mapping import Mapping from parameterization import ObsAr from .. import likelihoods 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 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 def predict(self, Xnew, full_cov=False, Y_metadata=None, kern=None):