In kernel ridge regression, predictions take the form f(x)=∑i=1nαik(xi,x) with weights α=(K+λI)−1y, where Kij=k(xi,xj) is the kernel matrix, y is the vector of targets, λ>0 is the regularisation parameter and I is the identity matrix. For two training points with K=(10.50.51), y=(1,0)⊤ and λ=0.5, what are α and the prediction f(x) at a new point with k(x1,x)=0.8 and k(x2,x)=0.2?

Learning theory, RKHS and the representer theorem
Level L2 Elementary. Length Medium. Nature Mat Mathematical.

What's being asked

Whether you can solve the 2×2 kernel ridge linear system and compute the resulting kernel prediction at a test point.

Key idea

Add λI to the diagonal of K, invert the 2×2 matrix to find the dual weights α=(K+λI)−1y, and take the weighted sum α1k(x1,x)+α2k(x2,x) using the kernel similarities to the new point.

Steps

  1. Form K+λI: adding λ=0.5 to the diagonal gives K+λI=(1.50.50.51.5).
  2. Invert the 2×2 matrix: the determinant is 1.52−0.52=2.25−0.25=2, so (K+λI)−1=12(1.5−0.5−0.51.5).
  3. Solve for α: multiplying by y=(1,0)⊤ selects the first column, giving α=12(1.5−0.5)=(0.75−0.25).
  4. Compute the prediction at x: f(x)=α1k(x1,x)+α2k(x2,x)=0.75(0.8)−0.25(0.2)=0.60−0.05=0.55 (why the solution takes this kernel form is proved by the representer theorem at later levels).

Common mistakes

How long your answer should be

4–5 lines of arithmetic; 2–3 minutes.

Read this

Previous in Learning theory: A class has VC dimension 3. By Sauer's lemma, at most how many different labellings can it produce on 10 points? What fraction of all 210 labellings is that, and what does the bound say for m=3?
Next in Learning theory: Why is VCdim⁡(H)≤log⁡2∣H∣ for a finite class H, and is the bound tight?