我已经计算了两个GP回归模型,并希望将它们绘制在同一个图形中。在
模型1
kernel = GPy.kern.RBF(input_dim=1, variance=.1, lengthscale=1.)
m1 = GPy.models.GPRegression(xa, ya,kernel)
m1.optimize_restarts(num_restarts = 10)
m1.optimize(messages=True)
from IPython.display import display
display(m1)
fig1 = m1.plot(plot_density=True)
m1.plot(plot_density=True)
GPy.plotting.show(fig2, filename='2')
型号2
^{2}$我希望两个图形都在一个图形中,可以是matplotlib,也可以是plotly,即GPy.plotting.show(fig, filename='filename')
。在
谢谢
使用
matplotlib
,您可以定义一个子批次,并使用相同的轴指定要使用的子批次(特别是paramax
)。在我用一个测试数据集测试了这一点:
^{pr2}$相关: What is the best way of combining two independent plots with matplotlib?
相关问题 更多 >
编程相关推荐