How can the principal components in a feature space ϕ(x) be found by solving an eigenvalue problem for the n×n kernel matrix K, with Kij=k(xi,xj)=ϕ(xi)⊤ϕ(xj)? How are the coefficients normalised, how is K centred, and how is a new point projected?

Unsupervised learning, Dimensionality reduction
Level L4 Advanced. Length Long. Nature Mat Mathematical.

What's being asked

Whether you can write feature-space eigenvectors as combinations of the mapped data points and reduce every step to kernel values.

Key idea

An eigenvector v of the feature-space covariance C=1n∑iϕ(xi)ϕ(xi)⊤ with eigenvalue λ>0 is a combination of the mapped points, v=∑iαiϕ(xi). Substituting gives Kα=nλα. Making ∥v∥=1 requires α⊤Kα=1, i.e. nλ∥α∥2=1. A new point x projects to ∑iαik(xi,x), using a centred kernel.

Steps

  1. Assume for now that the mapped points have mean zero, ∑iϕ(xi)=0; centring is handled below. From Cv=λv we get v=1nλ∑iϕ(xi)(ϕ(xi)⊤v). The brackets are numbers, so v is a combination of the ϕ(xi): v=∑jαjϕ(xj). This matters because ϕ may be huge, but α has only n entries.
  2. Substitute into Cv=λv and take the inner product with each ϕ(xl), so that only kernel values appear: 1n∑iKli∑jKijαj=λ∑jKljαj for every l. In matrix form, K2α=nλKα. For components with λ>0 it is enough to solve Kα=nλα.
  3. Normalise: v⊤v=∑i,jαiαjKij=α⊤Kα=nλ α⊤α, and this must equal 1. So if K has eigenvalue μ=nλ with unit-length eigenvector e, use α=e/μ.
  4. Centre the kernel. We cannot subtract the mean of ϕ directly, but the kernel matrix of the centred features is K~=K−1nK−K1n+1nK1n, where 1n is the n×n matrix with every entry 1/n. Use K~ in place of K throughout.
  5. Project a new point: its coordinate along v is v⊤ϕ(x)=∑iαik~(xi,x), where k~ is centred using the training means. Only kernel evaluations are needed, never ϕ itself.
  6. Add an example of why it is useful: with the RBF kernel exp⁡(−∥x−z∥2/2σ2), kernel PCA can turn data such as two concentric rings into components that separate them, which linear PCA cannot do.

Common mistakes

How long your answer should be

About a page; 6–8 minutes.

Last checked on 4 December 2026.

Read this

Previous in Unsupervised learning: How is k-means a limiting case of EM for a Gaussian mixture model, and what assumptions about the clusters does this reveal?
Next in Unsupervised learning: A linear autoencoder with a k-dimensional bottleneck, encoder W1∈Rk×d and decoder W2∈Rd×k, is trained with squared reconstruction error on centred data. How does its solution relate to PCA, and what changes with a nonlinear autoencoder?