[plotting&kern] bugfixes in plotting and kernel size

This commit is contained in:
Max Zwiessele 2016-01-22 11:26:29 +00:00
parent 1bda209469
commit 7b5422b694
5 changed files with 21 additions and 17 deletions

View file

@ -46,7 +46,7 @@ def plot_mean(self, plot_limits=None, fixed_inputs=None,
"""
Plot the mean of the GP.
You can deactivate the legend for this one plot by supplying None to label.
You can deactivate the legend for this one plot by supplying None to label.
Give the Y_metadata in the predict_kw if you need it.
@ -116,7 +116,7 @@ def plot_confidence(self, lower=2.5, upper=97.5, plot_limits=None, fixed_inputs=
E.g. the 95% confidence interval is $2.5, 97.5$.
Note: Only implemented for one dimension!
You can deactivate the legend for this one plot by supplying None to label.
You can deactivate the legend for this one plot by supplying None to label.
Give the Y_metadata in the predict_kw if you need it.
@ -170,7 +170,7 @@ def plot_samples(self, plot_limits=None, fixed_inputs=None,
"""
Plot the mean of the GP.
You can deactivate the legend for this one plot by supplying None to label.
You can deactivate the legend for this one plot by supplying None to label.
Give the Y_metadata in the predict_kw if you need it.
@ -231,7 +231,7 @@ def plot_density(self, plot_limits=None, fixed_inputs=None,
E.g. the 95% confidence interval is $2.5, 97.5$.
Note: Only implemented for one dimension!
You can deactivate the legend for this one plot by supplying None to label.
You can deactivate the legend for this one plot by supplying None to label.
Give the Y_metadata in the predict_kw if you need it.
@ -288,7 +288,7 @@ def plot(self, plot_limits=None, fixed_inputs=None,
"""
Convenience function for plotting the fit of a GP.
You can deactivate the legend for this one plot by supplying None to label.
You can deactivate the legend for this one plot by supplying None to label.
Give the Y_metadata in the predict_kw if you need it.
@ -330,6 +330,8 @@ def plot(self, plot_limits=None, fixed_inputs=None,
# It does not make sense to plot the data (which lives not in the latent function space) into latent function space.
plot_data = False
plots = {}
if hasattr(self, 'Z') and plot_inducing:
plots.update(_plot_inducing(self, canvas, visible_dims, projection, 'Inducing'))
if plot_data:
plots.update(_plot_data(self, canvas, which_data_rows, which_data_ycols, visible_dims, projection, "Data"))
plots.update(_plot_data_error(self, canvas, which_data_rows, which_data_ycols, visible_dims, projection, "Data Error"))
@ -340,8 +342,6 @@ def plot(self, plot_limits=None, fixed_inputs=None,
get_which_data_ycols(self, which_data_ycols),
predict_kw, samples_likelihood)
plots.update(_plot_samples(canvas, helper_data, helper_prediction, projection, "Lik Samples"))
if hasattr(self, 'Z') and plot_inducing:
plots.update(_plot_inducing(self, canvas, visible_dims, projection, 'Inducing'))
return pl().add_to_canvas(canvas, plots, legend=legend)
@ -362,7 +362,7 @@ def plot_f(self, plot_limits=None, fixed_inputs=None,
If you want fine graned control use the specific plotting functions supplied in the model.
You can deactivate the legend for this one plot by supplying None to label.
You can deactivate the legend for this one plot by supplying None to label.
Give the Y_metadata in the predict_kw if you need it.

View file

@ -285,7 +285,10 @@ def get_x_y_var(model):
X = model.X.mean.values
X_variance = model.X.variance.values
else:
X = model.X.values
try:
X = model.X.values
except AttributeError:
X = model.X
X_variance = None
try:
Y = model.Y.values