From 4be40da23a3086b004de75da1652c4f633bb715c Mon Sep 17 00:00:00 2001 From: Ricardo Date: Mon, 11 Nov 2013 14:23:10 +0000 Subject: [PATCH] Changes in plot function: sampling vs numerical approximation --- GPy/core/gp_base.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/GPy/core/gp_base.py b/GPy/core/gp_base.py index b6e4ebc0..cb968520 100644 --- a/GPy/core/gp_base.py +++ b/GPy/core/gp_base.py @@ -173,7 +173,8 @@ class GPBase(Model): upper = m + 2*np.sqrt(v) Y = self.likelihood.Y else: - m, v, lower, upper = self.predict(Xgrid, which_parts=which_parts) + m, v, lower, upper = self.predict(Xgrid, which_parts=which_parts,sampling=False) #Compute the exact mean + m_, v_, lower, upper = self.predict(Xgrid, which_parts=which_parts,sampling=True,num_samples=15000) #Apporximate the percentiles Y = self.likelihood.data for d in which_data_ycols: gpplot(Xnew, m[:, d], lower[:, d], upper[:, d], axes=ax, edgecol=linecol, fillcol=fillcol) @@ -210,7 +211,7 @@ class GPBase(Model): m, _ = self._raw_predict(Xgrid, which_parts=which_parts) Y = self.likelihood.Y else: - m, _, _, _ = self.predict(Xgrid, which_parts=which_parts,num_samples=100) #FIXME we need a balance between accuracy and speed to define num_samples + m, _, _, _ = self.predict(Xgrid, which_parts=which_parts,sampling=False) Y = self.likelihood.data for d in which_data_ycols: m_d = m[:,d].reshape(resolution, resolution).T