5.1 Hilbert Spaces
Inner-product spaces as the setting for kernels.
These notes walk through the lecture slides. The original deck is unchanged; use (slides) on the course hub if you want that PDF.
The figures follow Deisenroth, Faisal, and Ong, Mathematics for Machine Learning, Theodoridis, and Géron, Hands-On Machine Learning.
1. Central idea
Many datasets live on a nonlinear set. One response is to map the inputs to a new space where the same task becomes linear. Choosing that map is not obvious.
Given pairs for , apply with so that the images are linearly separable in .
Points that cannot be separated by a line in the original plane can be separated by a plane after a nonlinear map into 3-space. You have embedded an -dimensional manifold in a -dimensional space so the two classes become linearly separable.
Working in that high-dimensional space is expensive: many parameters, computational cost, and a real risk of overfitting.

2. Kernels and RKHS
Instead of writing and computing inner products of and , define a similarity . For a class of similarities called kernels, that function implicitly defines a feature map .
Let be a Hilbert space of real-valued functions: an inner product, and completeness in the induced norm. is a reproducing kernel Hilbert space (RKHS) if there is a kernel such that every and every satisfy . In this course, think and .
Each kernel has a unique RKHS (Aronszajn, 1950). The canonical feature map is , and is the feature space.
The kernel trick: for any two points,
Inner products in become a function evaluation in the original low-dimensional space.

The nonlinear task in the original space is linear in the RKHS. In practice: (a) write the algorithm using only inner products in the original space, then (b) replace those inner products by kernel evaluations.
The matrix of those pairwise evaluations is the kernel matrix. Every kernel matrix is symmetric and positive semidefinite.
Choose the kernel (and its parameters) by nested cross-validation. The specific formula for does not enter the derivation. After you have the predictor, you can swap kernels; each choice is a different nonlinearity.
3. Representer theorem
The representer theorem lets you optimize an empirical loss over a finite sample even when lives in a very high-dimensional (even infinite-dimensional) RKHS.
Theorem. Let be strictly increasing, and let be any loss. Each minimizer of
has the form
with .
To minimize you plug in that expansion and optimize only the finite list .
4. Practice
-
What does the kernel trick replace an inner product in with?
-
Why is working with an explicit high-dimensional map expensive?
-
What does the representer theorem say you may optimize instead of the function ?