mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-04-25 12:56:22 +02:00
Update plotting_tests.py
This commit is contained in:
parent
cb18d151fb
commit
c07f3dbe98
1 changed files with 57 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue