Why must a valid kernel function satisfy Mercer's condition?

Quick Overview

Explain why a kernel used in a support vector machine must satisfy Mercer's condition and what breaks when it does not. It tests your understanding of Gram matrices, feature-space inner products, and the convexity of the SVM dual problem.

Why must a valid kernel function satisfy Mercer's condition?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: hard

Interview Round: Other

Why must a valid kernel function satisfy Mercer's condition? Kernel methods such as support vector machines replace every inner product $\langle \phi(x), \phi(z) \rangle$ with a function $K(x, z)$. Explain what Mercer's condition requires of $K$ and what goes wrong when a kernel violates it. ```hint Feature-space distance Write the squared distance between two points in feature space using only $K$. What property of $K$ keeps that quantity from going negative? ``` ```hint Look at the dual Write the SVM dual objective. Which matrix appears in its quadratic term, and what must be true of it for the problem to be convex? ``` ### What a Strong Answer Covers - A precise statement of the condition: symmetry plus positive semi-definiteness of every finite Gram matrix, or the equivalent integral form - The link between the condition and the existence of a feature map with a real inner product (the RKHS) - What breaks geometrically with an indefinite kernel: norms, margins and distances - The effect on the convexity of the SVM dual and on the guarantee of a global optimum - How kernels that fail the condition are handled in practice, and how to build kernels that are valid by construction ### Follow-up Questions - Is the sigmoid kernel $\tanh(\gamma\, x \cdot z + r)$ a valid Mercer kernel? For which parameters can it fail? - How would you check whether a custom similarity function is a valid kernel, and how would you construct one that is guaranteed to be? - A precomputed similarity matrix has negative eigenvalues. What are your options, and what does each one mean for scoring new points? - Why does the representer theorem need the kernel to define an RKHS?

Overview: Explain why a kernel used in a support vector machine must satisfy Mercer's condition and what breaks when it does not. It tests your understanding of Gram matrices, feature-space inner products, and the convexity of the SVM dual problem.

General logo
General
Nov 25, 2026
hardMachine Learning EngineerOtherMachine Learning
0
0

Why must a valid kernel function satisfy Mercer's condition? Kernel methods such as support vector machines replace every inner product ⟨ϕ(x),ϕ(z)⟩\langle \phi(x), \phi(z) \rangle with a function K(x,z)K(x, z). Explain what Mercer's condition requires of KK and what goes wrong when a kernel violates it.

What a Strong Answer Covers Guidance

  • A precise statement of the condition: symmetry plus positive semi-definiteness of every finite Gram matrix, or the equivalent integral form
  • The link between the condition and the existence of a feature map with a real inner product (the RKHS)
  • What breaks geometrically with an indefinite kernel: norms, margins and distances
  • The effect on the convexity of the SVM dual and on the guarantee of a global optimum
  • How kernels that fail the condition are handled in practice, and how to build kernels that are valid by construction

Follow-up Questions Guidance

  • Is the sigmoid kernel tanh⁡(γ x⋅z+r)\tanh(\gamma\, x \cdot z + r) a valid Mercer kernel? For which parameters can it fail?
  • How would you check whether a custom similarity function is a valid kernel, and how would you construct one that is guaranteed to be?
  • A precomputed similarity matrix has negative eigenvalues. What are your options, and what does each one mean for scoring new points?
  • Why does the representer theorem need the kernel to define an RKHS?