mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-24 14:15:14 +02:00
[plotting] added plotting for missing data
This commit is contained in:
parent
29a81c72c1
commit
452c662084
1 changed files with 7 additions and 1 deletions
|
|
@ -147,6 +147,7 @@ def _plot_magnification(self, canvas, which_indices, Xgrid,
|
||||||
def plot_function(x):
|
def plot_function(x):
|
||||||
Xtest_full = np.zeros((x.shape[0], Xgrid.shape[1]))
|
Xtest_full = np.zeros((x.shape[0], Xgrid.shape[1]))
|
||||||
Xtest_full[:, which_indices] = x
|
Xtest_full[:, which_indices] = x
|
||||||
|
|
||||||
mf = self.predict_magnification(Xtest_full, kern=kern, mean=mean, covariance=covariance)
|
mf = self.predict_magnification(Xtest_full, kern=kern, mean=mean, covariance=covariance)
|
||||||
return mf.reshape(resolution, resolution).T
|
return mf.reshape(resolution, resolution).T
|
||||||
imshow_kwargs = update_not_existing_kwargs(imshow_kwargs, pl().defaults.magnification)
|
imshow_kwargs = update_not_existing_kwargs(imshow_kwargs, pl().defaults.magnification)
|
||||||
|
|
@ -215,7 +216,12 @@ def _plot_latent(self, canvas, which_indices, Xgrid,
|
||||||
def plot_function(x):
|
def plot_function(x):
|
||||||
Xtest_full = np.zeros((x.shape[0], Xgrid.shape[1]))
|
Xtest_full = np.zeros((x.shape[0], Xgrid.shape[1]))
|
||||||
Xtest_full[:, which_indices] = x
|
Xtest_full[:, which_indices] = x
|
||||||
mf = np.log(self.predict(Xtest_full, kern=kern)[1])
|
mf = self.predict(Xtest_full, kern=kern)[1]
|
||||||
|
if mf.shape[1]==self.output_dim:
|
||||||
|
mf = mf.sum(-1)
|
||||||
|
else:
|
||||||
|
mf *= self.output_dim
|
||||||
|
mf = np.log(mf)
|
||||||
return mf.reshape(resolution, resolution).T
|
return mf.reshape(resolution, resolution).T
|
||||||
|
|
||||||
imshow_kwargs = update_not_existing_kwargs(imshow_kwargs, pl().defaults.latent)
|
imshow_kwargs = update_not_existing_kwargs(imshow_kwargs, pl().defaults.latent)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue