diff --git a/doc/conf.py b/doc/conf.py index 078279d4..8a05f386 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -103,7 +103,7 @@ class Mock(object): #import mock print "Mocking" -MOCK_MODULES = ['pylab', 'sympy', 'sympy.utilities', 'sympy.utilities.codegen', 'sympy.core.cache', 'sympy.core', 'sympy.parsing', 'sympy.parsing.sympy_parser'] +MOCK_MODULES = ['pylab', 'sympy', 'sympy.utilities', 'sympy.utilities.codegen', 'sympy.core.cache', 'sympy.core', 'sympy.parsing', 'sympy.parsing.sympy_parser', 'matplotlib'] #'matplotlib', 'matplotlib.color', 'matplotlib.pyplot', 'pylab' ] for mod_name in MOCK_MODULES: sys.modules[mod_name] = Mock() diff --git a/doc/tuto_GP_regression.rst b/doc/tuto_GP_regression.rst index 92b25bc0..a78929b3 100644 --- a/doc/tuto_GP_regression.rst +++ b/doc/tuto_GP_regression.rst @@ -2,6 +2,28 @@ Gaussian process regression tutorial ************************************* + +.. ipython:: python + + import numpy as np + import GPy as gpy + + """run a simple demonstration of a standard gaussian process fitting it to data sampled from an rbf covariance.""" + data = gpy.util.datasets.toy_rbf_1d() + + # create simple gp model + m = gpy.models.GP_regression(data['X'],data['Y']) + + # optimize + m.ensure_default_constraints() + m.optimize() + + print(m) + + # plot + m.plot() + + We will see in this tutorial the basics for building a 1 dimensional and a 2 dimensional Gaussian process regression model, also known as a kriging model. We first import the libraries we will need: ::