Kernel Method

A kernel method uses a similarity function to model nonlinear relationships without explicitly constructing all transformed features.

The kernel is an inner product in an implicit feature space:

A common prediction form is:

Intuition

The kernel defines what it means for two examples to be similar. A model can then behave like a linear method in an implicit high-dimensional feature space.

Kernel Matrix

For training examples , the kernel matrix is:

A valid kernel should produce a positive semidefinite matrix:

This condition means the kernel can be interpreted as an inner product in some feature space.

Examples

  • Support vector machine with an RBF kernel.
  • Kernel ridge regression.
  • Gaussian process models.

The radial basis function kernel is:

where controls the similarity length scale.

Polynomial kernels use:

Linear kernels recover ordinary linear models:

Kernel ridge regression solves:

where and is a regularization strength.

Length Scale and Normalization

The RBF length scale controls locality:

Behavior
too smalleach point only resembles itself; overfitting risk
too largeall points look similar; underfitting risk
tunedsimilarity matches task-relevant variation

Because many kernels depend on distance or dot product, input scale changes the model:

in general. Standardization or domain-specific feature scaling is often part of the kernel definition.

Kernel vs Neural Representation

Kernel methodNeural representation
similarity function is specified directlyrepresentation is learned from data
strong on small/medium data with good featuresstrong when representation learning is needed
training can scale poorly with optimization can scale with minibatches
easier to inspect similarity assumptionsharder but more flexible

Watch For

  • Kernel choice encodes strong assumptions.
  • Scaling to large datasets can be expensive.
  • Input normalization often matters.
  • Similarity must match the deployment notion of generalization.
  • Positive semidefinite assumptions matter for many algorithms.
  • A strong kernel baseline can reveal whether a neural model is actually learning useful representations.

When It Helps

  • Small or medium datasets where a strong similarity function is known.
  • Scientific settings where engineered features or distances are meaningful.
  • Baseline comparisons against neural representations.