Learn Before
Example

Quadratic Kernel Feature Mapping Example

The quadratic kernel provides a clear example of an implicit feature mapping. Instead of explicitly computing feature mappings f(x)f(\vec{x}) and f(z)f(\vec{z}) and then calculating their dot product f(x)f(z)f(\vec{x}) \cdot f(\vec{z}), the kernel efficiently computes this inner product in one step.

To see how the kernel and an explicit feature mapping relate, consider input vectors in R2\mathbb{R}^2. The explicit mapping to a higher-dimensional space, f([x1,x2]T)=[x12,x22,2x1x2,2x1,2x2,1]Tf([x_1, x_2]^T) = [x_1^2, x_2^2, \sqrt{2}x_1x_2, \sqrt{2}x_1, \sqrt{2}x_2, 1]^T, mathematically corresponds directly to the quadratic kernel function:

K(x,z)=(xz+1)2K(\vec{x},\vec{z}) = (\vec{x} \cdot \vec{z} + 1)^2

The accompanying proof visually demonstrates that evaluating K(x,z)K(\vec{x},\vec{z}) achieves the same exact result as the dot product of the transformed features, allowing the model to avoid the computationally expensive mapping step.

Image 0

0

1

Updated 2026-05-18

Tags

Data Science