A Gaussian process on a latent function a(x), squashed through a logistic sigmoid, becomes a classifier. The posterior over the latent values at the training points is not Gaussian, so the Laplace approximation finds its single mode by Newton-Raphson (an IRLS iteration), fits a Gaussian there, and gives a predictive probability and an approximate evidence for the hyperparameters (Figure 6.12). Compare a short and a long length scale, learn the hyperparameters, and step through the Newton iteration.
Data: a synthetic two-class set of the kind in Appendix A of Bishop (2006), Figure A.7: one Gaussian for the blue class and a mixture of two Gaussians for the red class, equal priors, generated in the browser with a seeded generator (the book’s own points are not available). Kernel θ0 exp(−θ1‖x−x′‖2/2) + νδ, ν = 10−4. The gradient of the evidence uses (I + CW)−1 in (6.94); the printed (I + WC)−1 does not match its own derivation (see the notes).
code/ch06_kernel_methods.py (functions laplace_mode, laplace_predict, laplace_evidence, gpc_fit; Figures 6.11 and 6.12) and code/checks_ch06.py (mode gradient zero, Newton monotone, evidence gradient by finite differences).