ArticleslgStudy

computer science

Polynomial kernel

Polynomial kernel is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Polynomial kernel rather than just read about it. In short: 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 simi…

Polynomial kernel — main illustration
Polynomial kernel — illustration

Key takeaways

  • Polynomial kernel belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Polynomial kernel to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Polynomial kernel from memory before moving on to harder problems.

Reference excerpt

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.

Definition For degree-d polynomials, the polynomial kernel is defined as

K ( x , y ) = ( x T y + c ) d {\displaystyle K(\mathbf {x} ,\mathbf {y} )=(\mathbf {x} ^{\mathsf {T}}\mathbf {y} +c)^{d}}

where x and y are vectors of size n in the input space, i.e. vectors of features computed from training or test samples and c ≥ 0 is a free parameter trading off the influence of higher-order versus lower-order terms in the polynomial. When c = 0, the kernel is called homogeneous. (A further generalized polykernel divides xTy by a user-specified scalar parameter a.) As a kernel, K corresponds to an inner product in a feature space based on some mapping φ:

K ( x , y ) = ⟨ φ ( x ) , φ ( y ) ⟩ {\displaystyle K(\mathbf {x} ,\mathbf {y} )=\langle \varphi (\mathbf {x} ),\varphi (\mathbf {y} )\rangle }

The nature of φ can be seen from an example. Let d = 2, 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 ) = ( ∑ i = 1 n x i y i + c ) 2 = ∑ i = 1 n ( x i 2 ) ( y i 2 ) + ∑ i = 2 n ∑ j = 1 i − 1 ( 2 x i x j ) ( 2 y i y j ) + ∑ i = 1 n ( 2 c x i ) ( 2 c y i ) + c 2 {\displaystyle K(\mathbf {x} ,\mathbf {y} )=\left(\sum _{i=1}^{n}x_{i}y_{i}+c\right)^{2}=\sum _{i=1}^{n}\left(x_{i}^{2}\right)\left(y_{i}^{2}\right)+\sum _{i=2}^{n}\sum _{j=1}^{i-1}\left({\sqrt {2}}x_{i}x_{j}\right)\left({\sqrt {2}}y_{i}y_{j}\right)+\sum _{i=1}^{n}\left({\sqrt {2c}}x_{i}\right)\left({\sqrt {2c}}y_{i}\right)+c^{2}}

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

… excerpt ends here. Continue reading the full article.

Illustrations

Polynomial kernel: Illustration of the mapping 
  
    
      
        φ
      
    
    {\displaystyle \varphi }
  
. 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
        )
      
    
    {\displaystyle K(x,y)}
  
 (for some values of the parameters 
  
    
      
        c
      
    
    {\displaystyle c}
  
 and 
  
    
      
        d
      
    
    {\displaystyle d}
  
) is the inner product. The hyperplane learned in feature space by an SVM is an ellipse in the input space.
Illustration of the mapping φ {\displaystyle \varphi } . 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 ) {\displaystyle K(x,y)} (for some values of the parameters c {\displaystyle c} and d {\displaystyle d} ) is the inner product. The hyperplane learned in feature space by an SVM is an ellipse in the input space.

Worked examples

Example 1 — a first encounter with Polynomial kernel

Start with the simplest possible case. Write down what Polynomial kernel claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Polynomial kernel before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Polynomial kernel ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Polynomial kernel

In research
Polynomial kernel appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Polynomial kernel in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Polynomial kernel is common in secondary-school and first-year university syllabi. It links to neighbouring topics Kernel methods for machine learning, so understanding it makes those chapters shorter.
In everyday life
Look for Polynomial kernel outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Polynomial kernel in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Polynomial kernel means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Polynomial kernel out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Polynomial kernel in simple terms?

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…

Why does Polynomial kernel matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Polynomial kernel?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Polynomial kernel.

Tags

  • Kernel methods for machine learning

Keep exploring