用简单数据集培训高斯过程预测器.
data = {-1.2 -> 1.2, 1.4 -> 1.4, 3.1 -> 1.8, 4.5 -> 1.6}; p = Predict[data, Method -> "GaussianProcess"]
可视化带有置信区间的预测值.
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"}]]