Kernel trick Created 2026-09-24 Updated 2026-10-14
The kernel trick evaluates inner products of feature map outputs through without explicitly constructing those vectors. An algorithm expressed entirely through these inner products can therefore operate on nonlinear derived coordinates using only evaluations of a positive-semidefinite kernel on the original inputs. A classifier linear in the derived coordinates can have a nonlinear boundary in the original coordinates.
The polynomial kernel gives a finite, fully visible example: corresponds to . The XOR separation by a product feature below makes the interaction coordinate useful, while dual prediction with a kernel shows how to predict without calculating it explicitly.
An arbitrary score called a similarity need not be a positive-semidefinite kernel. Symmetry alone, even with nonnegative entries, is insufficient: the symmetric matrix
has for , so it cannot be a Gram matrix of real inner products. A positive-semidefinite kernel requires a positive semidefinite matrix for every finite choice of inputs, not just the observed training data.[ref] The existing Moore-Aronszajn theorem connects this requirement to a Reproducing kernel Hilbert space; this example needs only finite linear algebra.
A real positive-semidefinite kernel is a symmetric function such that every finite Gram matrix is positive semidefinite. The Moore-Aronszajn theorem says that there are a Hilbert space and a feature map such that
Equivalently, can be chosen as the unique Reproducing kernel Hilbert space with reproducing kernel .
Reproducing kernel Hilbert space Created 2026-09-24 Updated 2026-11-05
A Reproducing kernel Hilbert space is a Hilbert space of functions on a set in which evaluation at each fixed point is a continuous linear functional. The Riesz representation theorem therefore supplies an element such that
Setting defines its positive-semidefinite kernel. The reproducing property turns pointwise information into an inner product; the Cauchy-Schwarz inequality gives
Thus small changes in the norm control evaluation at each fixed point. In the linear kernel example , the functions form the corresponding finite-dimensional space with the ordinary coefficient inner product. The Moore-Aronszajn theorem extends the correspondence to arbitrary positive-semidefinite kernels.[ref]