Wolfram Language

Improved Machine Learning

Visualize the Predictions of a Gaussian Process Model

Train a Gaussian process predictor on a simple dataset.

In[1]:=
Click for copyable input
data = {-1.2 -> 1.2, 1.4 -> 1.4, 3.1 -> 1.8, 4.5 -> 1.6}; p = Predict[data, Method -> "GaussianProcess"]
Out[1]=

Visualize the predicted values along with a confidence interval.

show complete Wolfram Language input
In[2]:=
Click for copyable input
Show[Plot[{ p[x], p[x] + StandardDeviation[p[x, "Distribution"]], p[x] - StandardDeviation[p[x, "Distribution"]] }, {x, -2, 6}, PlotStyle -> {Blue, Gray, Gray}, Filling -> {2 -> {3}}, Exclusions -> False, PerformanceGoal -> "Speed", PlotLegends -> {"Prediction", "Confidence Interval"}], ListPlot[List @@@ data, PlotStyle -> Red, PlotLegends -> {"Data"}]]
Out[2]=

Related Examples

de es fr ja ko pt-br ru zh