mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-09 12:02:38 +02:00
merged master
This commit is contained in:
parent
1a02c65a61
commit
a350e74b31
2 changed files with 6 additions and 2 deletions
|
|
@ -137,6 +137,7 @@ class WarpedGP(GP):
|
||||||
if self.normalizer is not None:
|
if self.normalizer is not None:
|
||||||
m, v = self.normalizer.inverse_mean(m), self.normalizer.inverse_variance(v)
|
m, v = self.normalizer.inverse_mean(m), self.normalizer.inverse_variance(v)
|
||||||
a, b = self.likelihood.predictive_quantiles(m, v, quantiles, Y_metadata)
|
a, b = self.likelihood.predictive_quantiles(m, v, quantiles, Y_metadata)
|
||||||
|
#return [a, b]
|
||||||
if not self.predict_in_warped_space:
|
if not self.predict_in_warped_space:
|
||||||
return [a, b]
|
return [a, b]
|
||||||
#print a.shape
|
#print a.shape
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,8 @@ def plot_data(model, which_data_rows='all',
|
||||||
#data
|
#data
|
||||||
X = model.X
|
X = model.X
|
||||||
Y = model.Y
|
Y = model.Y
|
||||||
|
if isinstance(model, WarpedGP) and model.predict_in_warped_space:
|
||||||
|
Y = model.Y_untransformed
|
||||||
|
|
||||||
#work out what the inputs are for plotting (1D or 2D)
|
#work out what the inputs are for plotting (1D or 2D)
|
||||||
if visible_dims is None:
|
if visible_dims is None:
|
||||||
|
|
@ -184,11 +186,12 @@ def plot_fit(model, plot_limits=None, which_data_rows='all',
|
||||||
|
|
||||||
if isinstance(model, WarpedGP):
|
if isinstance(model, WarpedGP):
|
||||||
m, v = model.predict(Xgrid, full_cov=False, median=True, Y_metadata=Y_metadata, **predict_kw)
|
m, v = model.predict(Xgrid, full_cov=False, median=True, Y_metadata=Y_metadata, **predict_kw)
|
||||||
|
lower, upper = model.predict_quantiles(Xgrid)
|
||||||
#print np.concatenate((Xgrid, m), axis=1)
|
#print np.concatenate((Xgrid, m), axis=1)
|
||||||
else:
|
else:
|
||||||
m, v = model.predict(Xgrid, full_cov=False, Y_metadata=Y_metadata, **predict_kw)
|
m, v = model.predict(Xgrid, full_cov=False, Y_metadata=Y_metadata, **predict_kw)
|
||||||
fmu, fv = model._raw_predict(Xgrid, full_cov=False, **predict_kw)
|
fmu, fv = model._raw_predict(Xgrid, full_cov=False, **predict_kw)
|
||||||
lower, upper = model.likelihood.predictive_quantiles(fmu, fv, (2.5, 97.5), Y_metadata=Y_metadata)
|
lower, upper = model.likelihood.predictive_quantiles(fmu, fv, (2.5, 97.5), Y_metadata=Y_metadata)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue