Polynomial kernel explained

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- polynomials, the polynomial kernel is defined as[2]

K(x,y)=(xTy+c)d

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

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

K(x,y)=\langle\varphi(x),\varphi(y)\rangle

The nature of can be seen from an example. Let, 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(x,y)=

n
\left(\sum
i=1

xiyi+c\right)2=

n
\sum
i=1
2\right)
\left(x
i
2
\left(y
i

\right)+

n
\sum
i=2
i-1
\sum
j=1

\left(\sqrt{2}xixj\right)\left(\sqrt{2}yiyj\right)+

n
\sum
i=1

\left(\sqrt{2c}xi\right)\left(\sqrt{2c}yi\right)+c2

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

\varphi(x)=\langle

2,
x
n

\ldots,

2,
x
1

\sqrt{2}xnxn-1,\ldots,\sqrt{2}xnx1,\sqrt{2}xn-1xn-2,\ldots,\sqrt{2}xn-1x1,\ldots,\sqrt{2}x2x1,\sqrt{2c}xn,\ldots,\sqrt{2c}x1,c\rangle

generalizing for

\left(xTy+c\right)d

,where

x\inRn

,

y\inRn

and applying the multinomial theorem:

\begin{alignat}{2}\left(xTy+c\right)d&=

\sum
j1+j2+...+jn+1=d
\sqrt{d!
} x_1^\cdots x_n^ \sqrt^\frac y_1^\cdots y_n^ \sqrt^\\&=\varphi(\mathbf)^ \varphi(\mathbf)\end

The last summation has

ld=\tbinom{n+d}{d}

elements, so that:

\varphi(x) = \left(a1,...,al

,...,a
ld

\right)

where,

al=

\sqrt{d!
}{\sqrt{j

1!jn!jn+1!}}

j1
x
1

jn
x
n
jn+1
\sqrt{c}

|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).[4] The most common degree is (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, tends to zero with increasing, whereas when, 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. Web site: Archived copy . 2012-11-12 . dead . https://web.archive.org/web/20130415231446/http://www.cs.tufts.edu/~roni/Teaching/CLT/LN/lecture18.pdf . 2013-04-15 .
  3. Shashua . Amnon . 0904.3664v1 . Introduction to Machine Learning: Class Notes 67577 . cs.LG . 2009.
  4. Yin-Wen . Chang . Cho-Jui . Hsieh . Kai-Wei . Chang . Michael . Ringgaard . Chih-Jen . Lin . 2010 . Training and testing low-degree polynomial data mappings via linear SVM . . 11 . 1471–1490.
  5. T. . Kudo . Y. . Matsumoto . 2003 . Fast methods for kernel-based text analysis . Proc. ACL.
  6. Chih-Jen . Lin . 2012 . Machine learning software: design and practical use . Machine Learning Summer School . Kyoto.