Take the Gaussian (RBF) kernel k(x,z)=exp⁡ ⁣(−(x−z)22) on the 1-D points x=0,1,3. Write the Gram matrix. What happens to the Gram matrix when the width is made very small and when it is made very large, and what does that mean for an SVM?

Supervised learning, RBF kernel
Level L2 Elementary. Length Medium. Nature Th+Mat Both.

What's being asked

Whether you can compute kernel values by hand and connect the kernel width to under- and overfitting.

Key idea

The Gram matrix has entries Kij=k(xi,xj). It is symmetric with ones on the diagonal. Entries are close to 1 for nearby points and close to 0 for far points.

Steps

  1. Diagonal entries: k(x,x)=e0=1.
  2. k(0,1)=e−1/2≈0.607, k(1,3)=e−4/2=e−2≈0.135, and k(0,3)=e−9/2≈0.011.
  3. So K=(10.6070.0110.60710.1350.0110.1351).
  4. Very small width (large γ in e−γ(x−z)2): off-diagonal entries tend to 0, so K→I. Every point is only similar to itself, so the SVM can separate any labelling and memorises the data (overfitting).
  5. Very large width (small γ): all entries tend to 1, so K→11⊤. All points look alike and the decision function is nearly constant (underfitting).
  6. So the kernel width, together with C, controls model complexity. It is tuned by cross-validation.

Common mistakes

How long your answer should be

A 3×3 matrix and 3–4 sentences.

Last checked on 4 December 2026.

Read this

Previous in Supervised learning: A node has 12 samples, 6 of each class. Attribute ID takes 12 distinct values (one per sample). Attribute B splits the samples into two groups of 6: (5 positive, 1 negative) and (1 positive, 5 negative). Compute the information gain and the gain ratio of both attributes. Which one does ID3 pick and which does C4.5 pick, and why?
Next in Supervised learning: In round 1 of AdaBoost on n=10 points with equal weights 0.1, a stump misclassifies 3 points. What are its error ε, its weight α, and the new normalised weights of the misclassified and the correctly classified points?