mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-04-29 23:06:22 +02:00
Nice plot handling in tutorials
This commit is contained in:
parent
dc26ea0dad
commit
fc57f470c2
2 changed files with 19 additions and 18 deletions
|
|
@ -115,24 +115,25 @@ def tuto_kernel_overview():
|
||||||
|
|
||||||
# Create GP regression model
|
# Create GP regression model
|
||||||
m = GPy.models.GPRegression(X, Y, Kanova)
|
m = GPy.models.GPRegression(X, Y, Kanova)
|
||||||
pb.figure(figsize=(5,5))
|
fig = pb.figure(figsize=(5,5))
|
||||||
m.plot()
|
ax = fig.add_subplot(111)
|
||||||
|
m.plot(ax=ax)
|
||||||
|
|
||||||
pb.figure(figsize=(20,3))
|
pb.figure(figsize=(20,3))
|
||||||
pb.subplots_adjust(wspace=0.5)
|
pb.subplots_adjust(wspace=0.5)
|
||||||
pb.subplot(1,5,1)
|
axs = pb.subplot(1,5,1)
|
||||||
m.plot()
|
m.plot(ax=axs)
|
||||||
pb.subplot(1,5,2)
|
pb.subplot(1,5,2)
|
||||||
pb.ylabel("= ",rotation='horizontal',fontsize='30')
|
pb.ylabel("= ",rotation='horizontal',fontsize='30')
|
||||||
pb.subplot(1,5,3)
|
axs = pb.subplot(1,5,3)
|
||||||
m.plot(which_parts=[False,True,False,False])
|
m.plot(ax=axs, which_parts=[False,True,False,False])
|
||||||
pb.ylabel("cst +",rotation='horizontal',fontsize='30')
|
pb.ylabel("cst +",rotation='horizontal',fontsize='30')
|
||||||
pb.subplot(1,5,4)
|
axs = pb.subplot(1,5,4)
|
||||||
m.plot(which_parts=[False,False,True,False])
|
m.plot(ax=axs, which_parts=[False,False,True,False])
|
||||||
pb.ylabel("+ ",rotation='horizontal',fontsize='30')
|
pb.ylabel("+ ",rotation='horizontal',fontsize='30')
|
||||||
pb.subplot(1,5,5)
|
axs = pb.subplot(1,5,5)
|
||||||
pb.ylabel("+ ",rotation='horizontal',fontsize='30')
|
pb.ylabel("+ ",rotation='horizontal',fontsize='30')
|
||||||
m.plot(which_parts=[False,False,False,True])
|
m.plot(ax=axs, which_parts=[False,False,False,True])
|
||||||
|
|
||||||
return(m)
|
return(m)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -230,19 +230,19 @@ The submodels can be represented with the option ``which_function`` of ``plot``:
|
||||||
|
|
||||||
pb.figure(figsize=(20,3))
|
pb.figure(figsize=(20,3))
|
||||||
pb.subplots_adjust(wspace=0.5)
|
pb.subplots_adjust(wspace=0.5)
|
||||||
pb.subplot(1,5,1)
|
axs = pb.subplot(1,5,1)
|
||||||
m.plot()
|
m.plot(ax=axs)
|
||||||
pb.subplot(1,5,2)
|
pb.subplot(1,5,2)
|
||||||
pb.ylabel("= ",rotation='horizontal',fontsize='30')
|
pb.ylabel("= ",rotation='horizontal',fontsize='30')
|
||||||
pb.subplot(1,5,3)
|
axs = pb.subplot(1,5,3)
|
||||||
m.plot(which_parts=[False,True,False,False])
|
m.plot(ax=axs, which_parts=[False,True,False,False])
|
||||||
pb.ylabel("cst +",rotation='horizontal',fontsize='30')
|
pb.ylabel("cst +",rotation='horizontal',fontsize='30')
|
||||||
pb.subplot(1,5,4)
|
axs = pb.subplot(1,5,4)
|
||||||
m.plot(which_parts=[False,False,True,False])
|
m.plot(ax=axs, which_parts=[False,False,True,False])
|
||||||
pb.ylabel("+ ",rotation='horizontal',fontsize='30')
|
pb.ylabel("+ ",rotation='horizontal',fontsize='30')
|
||||||
pb.subplot(1,5,5)
|
axs = pb.subplot(1,5,5)
|
||||||
pb.ylabel("+ ",rotation='horizontal',fontsize='30')
|
pb.ylabel("+ ",rotation='horizontal',fontsize='30')
|
||||||
m.plot(which_parts=[False,False,False,True])
|
m.plot(ax=axs, which_parts=[False,False,False,True])
|
||||||
|
|
||||||
.. pb.savefig('tuto_kern_overview_mANOVAdec.png',bbox_inches='tight')
|
.. pb.savefig('tuto_kern_overview_mANOVAdec.png',bbox_inches='tight')
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue