[plotting] tests

This commit is contained in:
Max Zwiessele 2016-04-12 09:02:10 +01:00
parent 108ae55fbc
commit 661d9f5724
43 changed files with 6 additions and 7 deletions

View file

@ -175,7 +175,7 @@ def _plot_inducing(self, canvas, visible_dims, projection, label, **plot_kwargs)
visible_dims = [i for i in sig_dims if i is not None]
free_dims = get_free_dims(self, visible_dims, None)
Z = self.Z[:, free_dims]
Z = self.Z.values
plots = {}
#one dimensional plotting

View file

@ -113,19 +113,18 @@ def plot_latent_inducing(self,
legend=False,
plot_limits=None,
marker=None,
num_samples=1000,
projection='2d',
**kwargs):
"""
Plot a scatter plot of the inducing inputs.
:param array-like labels: a label for each data point (row) of the inputs
:param (int, int) which_indices: which input dimensions to plot against each other
:param [int] which_indices: which input dimensions to plot against each other
:param bool legend: whether to plot the legend on the figure
:param plot_limits: the plot limits for the plot
:type plot_limits: (xmin, xmax, ymin, ymax) or ((xmin, xmax), (ymin, ymax))
:param str marker: marker to use [default is custom arrow like]
:param kwargs: the kwargs for the scatter plots
:param str projection: for now 2d or 3d projection (other projections can be implemented, see developer documentation)
"""
canvas, projection, kwargs, sig_dims = _new_canvas(self, projection, kwargs, which_indices)
@ -135,7 +134,7 @@ def plot_latent_inducing(self,
kwargs['marker'] = marker
update_not_existing_kwargs(kwargs, pl().defaults.inducing_2d) # @UndefinedVariable
from .data_plots import _plot_inducing
scatters = _plot_inducing(self, canvas, sig_dims[:2], projection, label, num_samples=num_samples, **kwargs)
scatters = _plot_inducing(self, canvas, sig_dims[:2], projection, label, **kwargs)
return pl().add_to_canvas(canvas, dict(scatter=scatters), legend=legend)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -252,7 +252,7 @@ def test_kernel():
k2.plot_ARD(['rbf', 'linear', 'bias'], legend=True)
k2.plot_covariance(visible_dims=[0, 3], plot_limits=(-1,3))
k2.plot_covariance(visible_dims=[2], plot_limits=(-1, 3))
k2.plot_covariance(visible_dims=[2, 4], plot_limits=((-1, 0), (5, 3)), projection='3d')
k2.plot_covariance(visible_dims=[2, 4], plot_limits=((-1, 0), (5, 3)), projection='3d', rstride=10, cstride=10)
k2.plot_covariance(visible_dims=[1, 4])
for do_test in _image_comparison(
baseline_images=['kern_{}'.format(sub) for sub in ["ARD", 'cov_2d', 'cov_1d', 'cov_3d', 'cov_no_lim']],
@ -325,7 +325,7 @@ def test_threed():
m.plot_samples(projection='3d', plot_raw=False, samples=1)
plt.close('all')
m.plot_data(projection='3d')
m.plot_mean(projection='3d')
m.plot_mean(projection='3d', rstride=10, cstride=10)
m.plot_inducing(projection='3d')
#m.plot_errorbars_trainset(projection='3d')
for do_test in _image_comparison(baseline_images=['gp_3d_{}'.format(sub) for sub in ["data", "mean", 'inducing',