Polynomial kernel

From testwiki
Jump to navigation Jump to search

Template:Short description Template:About

Illustration of the mapping φ. On the left a set of samples in the input space, on the right the same samples in the feature space where the polynomial kernel K(x,y) (for some values of the parameters c and d) is the inner product. The hyperplane learned in feature space by an SVM is an ellipse in the input space.

In machine learning, the polynomial kernel is a kernel function commonly used with support vector machines (SVMs) and other kernelized models, that represents the similarity of vectors (training samples) in a feature space over polynomials of the original variables, allowing learning of non-linear models.

Intuitively, the polynomial kernel looks not only at the given features of input samples to determine their similarity, but also combinations of these. In the context of regression analysis, such combinations are known as interaction features. The (implicit) feature space of a polynomial kernel is equivalent to that of polynomial regression, but without the combinatorial blowup in the number of parameters to be learned. When the input features are binary-valued (booleans), then the features correspond to logical conjunctions of input features.[1]

Definition

For degree-Template:Mvar polynomials, the polynomial kernel is defined as[2]

K(𝐱,𝐲)=(𝐱𝖳𝐲+c)d

where Template:Mvar and Template:Mvar are vectors of size Template:Mvar in the input space, i.e. vectors of features computed from training or test samples and Template:Math is a free parameter trading off the influence of higher-order versus lower-order terms in the polynomial. When Template:Math, the kernel is called homogeneous.[3] (A further generalized polykernel divides Template:Math by a user-specified scalar parameter Template:Mvar.Template:R)

As a kernel, Template:Mvar corresponds to an inner product in a feature space based on some mapping Template:Mvar:

K(𝐱,𝐲)=φ(𝐱),φ(𝐲)

The nature of Template:Mvar can be seen from an example. Let Template:Math, so we get the special case of the quadratic kernel. After using the multinomial theorem (twiceβ€”the outermost application is the binomial theorem) and regrouping,

K(𝐱,𝐲)=(i=1nxiyi+c)2=i=1n(xi2)(yi2)+i=2nj=1i1(2xixj)(2yiyj)+i=1n(2cxi)(2cyi)+c2

From this it follows that the feature map is given by:

φ(x)=(xn2,,x12,2xnxn1,,2xnx1,2xn1xn2,,2xn1x1,,2x2x1,2cxn,,2cx1,c)

generalizing for (𝐱T𝐲+c)d, where 𝐱ℝn, 𝐲ℝn and applying the multinomial theorem:

(𝐱T𝐲+c)d=j1+j2++jn+1=dd!j1!jn!jn+1!x1j1xnjncjn+1d!j1!jn!jn+1!y1j1ynjncjn+1=φ(𝐱)Tφ(𝐲)

The last summation has ld=(n+dd) elements, so that:

φ(𝐱)=(a1,,al,,ald)

where l=(j1,j2,...,jn,jn+1) and

al=d!j1!jn!jn+1!x1j1xnjncjn+1|j1+j2++jn+jn+1=d

Practical use

Although the RBF kernel is more popular in SVM classification than the polynomial kernel, the latter is quite popular in natural language processing (NLP).Template:R[4] The most common degree is Template:Math (quadratic), since larger degrees tend to overfit on NLP problems.

Various ways of computing the polynomial kernel (both exact and approximate) have been devised as alternatives to the usual non-linear SVM training algorithms, including:

One problem with the polynomial kernel is that it may suffer from numerical instability: when Template:Math, Template:Math tends to zero with increasing Template:Mvar, whereas when Template:Math, Template:Math tends to infinity.[6]

References

  1. ↑ Yoav Goldberg and Michael Elhadad (2008). splitSVM: Fast, Space-Efficient, non-Heuristic, Polynomial Kernel Computation for NLP Applications. Proc. ACL-08: HLT.
  2. ↑ Template:Cite web
  3. ↑ Template:Cite arXiv
  4. ↑ Template:Cite journal
  5. ↑ Template:Cite conference
  6. ↑ Template:Cite conference