diff --git a/GPy/testing/plotting_tests.py b/GPy/testing/plotting_tests.py index 462e361a..573a2cb0 100644 --- a/GPy/testing/plotting_tests.py +++ b/GPy/testing/plotting_tests.py @@ -77,6 +77,9 @@ def testPlot(): m.optimize() m.plot_data(ax=ax) m.plot_mean(ax=ax) + m.plot_mean(ax=ax, plot_raw=True) + m.plot_mean(ax=ax, apply_link=True) + m.plot_mean(ax=ax, plot_raw=True, apply_link=True) m.plot_confidence(ax=ax) m.plot_density(ax=ax) return ax @@ -93,8 +96,17 @@ def testPlotClassification(): m.optimize() m.plot_data(ax=ax) m.plot_mean(ax=ax) + m.plot_mean(ax=ax, plot_raw=True) + m.plot_mean(ax=ax, apply_link=True) + m.plot_mean(ax=ax, plot_raw=True, apply_link=True) m.plot_confidence(ax=ax) + m.plot_confidence(ax=ax, plot_raw=True) + m.plot_confidence(ax=ax, apply_link=True) + m.plot_confidence(ax=ax, plot_raw=True, apply_link=True) m.plot_density(ax=ax) + m.plot_density(ax=ax, plot_raw=True) + m.plot_density(ax=ax, apply_link=True) + m.plot_density(ax=ax, plot_raw=True, apply_link=True) return ax @image_comparison(baseline_images=['sparse_gp_class'], extensions=['pdf','png']) @@ -108,8 +120,18 @@ def testPlotSparseClassification(): m.optimize() m.plot_data(ax=ax) m.plot_mean(ax=ax) + m.plot_mean(ax=ax, plot_raw=True) + m.plot_mean(ax=ax, apply_link=True) + m.plot_mean(ax=ax, plot_raw=True, apply_link=True) m.plot_confidence(ax=ax) + m.plot_confidence(ax=ax, plot_raw=True) + m.plot_confidence(ax=ax, apply_link=True) + m.plot_confidence(ax=ax, plot_raw=True, apply_link=True) m.plot_density(ax=ax) + m.plot_density(ax=ax, plot_raw=True) + m.plot_density(ax=ax, apply_link=True) + m.plot_density(ax=ax, plot_raw=True, apply_link=True) + m.plot_inducing(ax=ax) return ax @image_comparison(baseline_images=['sparse_gp'], extensions=['pdf','png']) @@ -123,6 +145,41 @@ def testPlotSparse(): m.optimize() m.plot_data(ax=ax) m.plot_mean(ax=ax) + m.plot_mean(ax=ax, plot_raw=True) + m.plot_mean(ax=ax, apply_link=True) + m.plot_mean(ax=ax, plot_raw=True, apply_link=True) m.plot_confidence(ax=ax) + m.plot_confidence(ax=ax, plot_raw=True) + m.plot_confidence(ax=ax, apply_link=True) + m.plot_confidence(ax=ax, plot_raw=True, apply_link=True) m.plot_density(ax=ax) + m.plot_density(ax=ax, plot_raw=True) + m.plot_density(ax=ax, apply_link=True) + m.plot_density(ax=ax, plot_raw=True, apply_link=True) + m.plot_inducing(ax=ax) + return ax + +@image_comparison(baseline_images=['sparse_latent'], extensions=['pdf','png']) +def testPlotSparse(): + fig, ax = plt.subplots() + np.random.seed(11111) + X = np.random.uniform(0, 1, (40, 1)) + f = .2 * np.sin(1.3*X) + 1.3*np.cos(2*X) + Y = f+np.random.normal(0, .1, f.shape) + m = GPy.models.SparseGPRegression(X, Y) + m.optimize() + m.plot_data(ax=ax) + m.plot_mean(ax=ax) + m.plot_mean(ax=ax, plot_raw=True) + m.plot_mean(ax=ax, apply_link=True) + m.plot_mean(ax=ax, plot_raw=True, apply_link=True) + m.plot_confidence(ax=ax) + m.plot_confidence(ax=ax, plot_raw=True) + m.plot_confidence(ax=ax, apply_link=True) + m.plot_confidence(ax=ax, plot_raw=True, apply_link=True) + m.plot_density(ax=ax) + m.plot_density(ax=ax, plot_raw=True) + m.plot_density(ax=ax, apply_link=True) + m.plot_density(ax=ax, plot_raw=True, apply_link=True) + m.plot_inducing(ax=ax) return ax