Radial basis function kernel

From testwiki
Jump to navigation Jump to search

Template:Short description In machine learning, the radial basis function kernel, or RBF kernel, is a popular kernel function used in various kernelized learning algorithms. In particular, it is commonly used in support vector machine classification.[1]

The RBF kernel on two samples 𝐱,𝐱′∈ℝk, represented as feature vectors in some input space, is defined as[2]

K(𝐱,𝐱′)=exp⁡(−‖𝐱−𝐱′‖22σ2)

‖𝐱−𝐱′‖2 may be recognized as the squared Euclidean distance between the two feature vectors. σ is a free parameter. An equivalent definition involves a parameter γ=12σ2:

K(𝐱,𝐱′)=exp⁡(−γ‖𝐱−𝐱′‖2)

Since the value of the RBF kernel decreases with distance and ranges between zero (in the infinite-distance limit) and one (when Template:Math), it has a ready interpretation as a similarity measure.[2] The feature space of the kernel has an infinite number of dimensions; for σ=1, its expansion using the multinomial theorem is:[3]

exp⁡(−12‖𝐱−𝐱′‖2)=exp⁡(22𝐱⊤𝐱′−12‖𝐱‖2−12‖𝐱′‖2)=exp⁡(𝐱⊤𝐱′)exp⁡(−12‖𝐱‖2)exp⁡(−12‖𝐱′‖2)=∑j=0∞(𝐱⊤𝐱′)jj!exp⁡(−12‖𝐱‖2)exp⁡(−12‖𝐱′‖2)=∑j=0∞∑n1+n2+⋯+nk=jexp⁡(−12‖𝐱‖2)x1n1⋯xknkn1!⋯nk!exp⁡(−12‖𝐱′‖2)x′1n1⋯x′knkn1!⋯nk!=⟨φ(𝐱),φ(𝐱′)⟩

φ(𝐱)=exp⁡(−12‖𝐱‖2)(aℓ0(0),a1(1),…,aℓ1(1),…,a1(j),…,aℓj(j),…) where Template:Nowrap aℓ(j)=x1n1⋯xknkn1!⋯nk!|n1+n2+⋯+nk=j∧1≤ℓ≤ℓj

Approximations

Because support vector machines and other models employing the kernel trick do not scale well to large numbers of training samples or large numbers of features in the input space, several approximations to the RBF kernel (and similar kernels) have been introduced.[4] Typically, these take the form of a function z that maps a single vector to a vector of higher dimensionality, approximating the kernel:

⟨z(𝐱),z(𝐱′)⟩≈⟨φ(𝐱),φ(𝐱′)⟩=K(𝐱,𝐱′)

where φ is the implicit mapping embedded in the RBF kernel.

Fourier random features

Template:Main

One way to construct such a z is to randomly sample from the Fourier transformation of the kernel[5]φ(x)=1D[cos⁡⟨w1,x⟩,sin⁡⟨w1,x⟩,…,cos⁡⟨wD,x⟩,sin⁡⟨wD,x⟩]Twhere w1,...,wD are independent samples from the normal distribution N(0,σ−2I).

Theorem: E⁡[⟨φ(x),φ(y)⟩]=e‖x−y‖2/(2σ2).

Proof: It suffices to prove the case of D=1. Use the trigonometric identity cos⁡(a−b)=cos⁡(a)cos⁡(b)+sin⁡(a)sin⁡(b), the spherical symmetry of Gaussian distribution, then evaluate the integral

∫−∞∞cos⁡(kx)e−x2/22πdx=e−k2/2.

Theorem: Var⁡[⟨φ(x),φ(y)⟩]=O(D−1). (Appendix A.2[6]).

Nyström method

Another approach uses the Nyström method to approximate the eigendecomposition of the Gram matrix K, using only a random sample of the training set.[7]

See also

References

Template:Reflist