ArticleslgStudy

computer science

Kernel principal component analysis

Kernel principal component analysis 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 Kernel principal component analysis rather than just read about it. In short: In the field of multivariate statistics, kernel principal component analysis (kernel PCA) is an extension of principal component analysis (PCA) using techniques of kernel methods. Using a kernel, the originally linear operations of PCA are performed in a reproducing kernel Hilbert space.

Kernel principal component analysis — main illustration
Kernel principal component analysis — illustration

Key takeaways

  • Kernel principal component analysis 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 Kernel principal component analysis to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Kernel principal component analysis from memory before moving on to harder problems.

Reference excerpt

In the field of multivariate statistics, kernel principal component analysis (kernel PCA) is an extension of principal component analysis (PCA) using techniques of kernel methods. Using a kernel, the originally linear operations of PCA are performed in a reproducing kernel Hilbert space.

Background: Linear PCA Recall that conventional PCA operates on zero-centered data; that is,

1 N ∑ i = 1 N x i = 0 {\displaystyle {\frac {1}{N}}\sum _{i=1}^{N}\mathbf {x} _{i}=\mathbf {0} } , where x i {\displaystyle \mathbf {x} _{i}} is one of the N {\displaystyle N} multivariate observations. It operates by diagonalizing the covariance matrix,

C = 1 N ∑ i = 1 N x i x i ⊤ {\displaystyle C={\frac {1}{N}}\sum _{i=1}^{N}\mathbf {x} _{i}\mathbf {x} _{i}^{\top }}

in other words, it gives an eigendecomposition of the covariance matrix:

λ v = C v {\displaystyle \lambda \mathbf {v} =C\mathbf {v} }

which can be rewritten as

λ x i ⊤ v = x i ⊤ C v for i = 1 , … , N {\displaystyle \lambda \mathbf {x} _{i}^{\top }\mathbf {v} =\mathbf {x} _{i}^{\top }C\mathbf {v} \quad {\textrm {for}}~i=1,\ldots ,N} . (See also: Covariance matrix as a linear operator)

Introduction of the Kernel to PCA To understand the utility of kernel PCA, particularly for clustering, observe that, while N points cannot, in general, be linearly separated in d < N {\displaystyle d<N} dimensions, they can almost always be linearly separated in d ≥ N {\displaystyle d\geq N} dimensions. That is, given N points, x i {\displaystyle \mathbf {x} _{i}} , if we map them to an N-dimensional space with

Φ ( x i ) {\displaystyle \Phi (\mathbf {x} _{i})} where Φ : R d → R N {\displaystyle \Phi :\mathbb {R} ^{d}\to \mathbb {R} ^{N}} , it is easy to construct a hyperplane that divides the points into arbitrary clusters. Of course, this Φ {\displaystyle \Phi } creates linearly independent vectors, so there is no covariance on which to perform eigendecomposition explicitly as we would in linear PCA. Instead, in kernel PCA, a non-trivial, arbitrary Φ {\displaystyle \Phi } function is 'chosen' that is never calculated explicitly, allowing the possibility to use very-high-dimensional Φ {\displaystyle \Phi } 's if we never have to actually evaluate the data in that space. Since we generally try to avoid working in the Φ {\displaystyle \Phi } -space, which we will call the 'feature space', we can create the N-by-N kernel

K = k ( x , y ) = ( Φ ( x ) , Φ ( y ) ) = Φ ( x ) T Φ ( y ) {\displaystyle K=k(\mathbf {x} ,\mathbf {y} )=(\Phi (\mathbf {x} ),\Phi (\mathbf {y} ))=\Phi (\mathbf {x} )^{T}\Phi (\mathbf {y} )}

… excerpt ends here. Continue reading the full article.

Illustrations

Kernel principal component analysis: Output after kernel PCA with 
  
    
      
        k
        (
        
          x
        
        ,
        
          y
        
        )
        =
        (
        
          
            x
          
          
            
              T
            
          
        
        
          y
        
        +
        1
        
          )
          
            2
          
        
      
    
    {\displaystyle k({\boldsymbol {x}},{\boldsymbol {y}})=({\boldsymbol {x}}^{\mathrm {T} }{\boldsymbol {y}}+1)^{2}}
  
. The three groups are distinguishable using the first component only.
Output after kernel PCA with k ( x , y ) = ( x T y + 1 ) 2 {\displaystyle k({\boldsymbol {x}},{\boldsymbol {y}})=({\boldsymbol {x}}^{\mathrm {T} }{\boldsymbol {y}}+1)^{2}} . The three groups are distinguishable using the first component only.
Kernel principal component analysis: Output after kernel PCA, with a Gaussian kernel.
Output after kernel PCA, with a Gaussian kernel.

Worked examples

Example 1 — a first encounter with Kernel principal component analysis

Start with the simplest possible case. Write down what Kernel principal component analysis 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 Kernel principal component analysis 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 Kernel principal component analysis 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 Kernel principal component analysis

In research
Kernel principal component analysis 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 Kernel principal component analysis 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
Kernel principal component analysis is common in secondary-school and first-year university syllabi. It links to neighbouring topics Dimension reduction, Kernel methods for machine learning, Machine learning algorithms, so understanding it makes those chapters shorter.
In everyday life
Look for Kernel principal component analysis 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 Kernel principal component analysis in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Kernel principal component analysis 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 Kernel principal component analysis out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Kernel principal component analysis in simple terms?

In the field of multivariate statistics, kernel principal component analysis (kernel PCA) is an extension of principal component analysis (PCA) using techniques of kernel methods. Using a kernel, the originally linear operations of PCA are performed in a reproducing kernel Hilbert space.

Why does Kernel principal component analysis 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 Kernel principal component analysis?

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 Kernel principal component analysis.

Tags

  • Dimension reduction
  • Kernel methods for machine learning
  • Machine learning algorithms
  • Signal processing

Keep exploring