Extend PCA to handle nonlinear data through the kernel trick. Learn how to perform PCA in high-dimensional feature spaces without explicit computation.
Standard PCA is a linear dimensionality reduction method. When data lies on a nonlinear manifold (e.g., a curved surface in high-dimensional space), linear PCA cannot capture the structure. Kernel PCA addresses this by mapping data to a high-dimensional feature space where it becomes linear.
Map samples to a high-dimensional feature space via nonlinear mapping, then perform PCA in that space:
The kernel trick allows us to compute PCA in feature space without explicitly computing.
Instead of explicitly computing (which may be infinite-dimensional), we use a kernel function that computes inner products in feature space:
Common kernel functions:
Polynomial Kernel:
RBF (Gaussian) Kernel:
In feature space, the covariance matrix is:
The projection matrix in feature space can be expressed as:
Define the kernel matrix where. The eigenvalue problem becomes:
Where contains the coefficients.
For a new sample , its projection onto the j-th principal component is:
Where is the coefficient for the j-th principal component and sample . This allows projection without explicit feature mapping.