GP Prediction: Mean and Uncertainty
What you'll learn: How to use a trained Gaussian Process to predict both the most likely value and how confident the model is at any new test point.
The Core Idea
Once you've conditioned a Gaussian Process on your training data (the GP posterior from the previous lesson), you can make predictions at new test points. Unlike ordinary regression models that give you a single number, a GP gives you a full probability distribution at each test point—specifically, a mean (the predicted value) and a variance (uncertainty).
Think of it like asking a weather forecaster not just "Will it rain?" but "How confident are you?" A GP naturally quantifies both the prediction and its uncertainty.
How It Works
For any new test point x*, the GP posterior provides:
- Predictive mean: The most likely output value, computed using the kernel's covariance between x* and your training data
- Predictive variance: How uncertain the model is, which grows when x* is far from training points and shrinks near observed data
This variance lets you construct confidence intervals—typically 95% intervals using ±2 standard deviations around the mean. These intervals are narrow where you have lots of data and wide in unexplored regions.
Why It Matters
This uncertainty quantification is the superpower of GPs. When deploying models in critical applications (medicine, robotics, finance), knowing when your model doesn't know is as important as the prediction itself. GPs make this explicit, not as an afterthought.
Key Takeaway: GP predictions deliver both a mean estimate and a principled measure of uncertainty at every test point, enabling confidence intervals that reflect how much training data supports each prediction.