Lably
Skip to content

Kernel perceptron

  • 4 min read
  • 3 chapters

Related on Lably

Through Machine learning, Perceptron and Pseudocode

Preliminaries

The perceptron algorithm

The perceptron algorithm is an online learning algorithm that operates by a principle called "error-driven learning". It iteratively improves a model by running it on training samples, then updating the model whenever it finds it has made an incorrect classification with respect to a supervised signal. The model learned by the standard perceptron algorithm is a linear binary classifier: a vector of weights w (and optionally an intercept term b, omitted here for simplicity) that is used to classify a sample vector x as class "one" or class "minus one" according to

y^=sgn⁡(w⊤x)

where a zero is arbitrarily mapped to one or minus one. (The "hat" on ŷ denotes an estimated value.)

In pseudocode, the perceptron algorithm is given by:

Initialize w to an all-zero vector of length p, the number of predictors (features).
For some fixed number of iterations, or until some stopping criterion is met:
For each training example xi with ground truth label yi ∈ {-1, 1}:
Let ŷ = sgn(wT xi).
If ŷ ≠ yi, update w ← w + yi xi.

Kernel Methods

By contrast with the linear models learned by the perceptron, a kernel method is a classifier that stores a subset of its training examples xi, associates with each a weight αi, and makes decisions for new samples x' by evaluating

sgn⁡∑iαiyiK(xi,x′).

Here, K is some kernel function. Formally, a kernel function is a non-negative semidefinite kernel (see Mercer's condition), representing an inner product between samples in a high-dimensional space, as if the samples had been expanded to include additional features by a function Φ: K(x, x') = Φ(x) · Φ(x'). Intuitively, it can be thought of as a similarity function between samples, so the kernel machine establishes the class of a new sample by weighted comparison to the training set. Each function x' ↦ K(xi, x') serves as a basis function in the classification.

Sign in to keep reading

2 more chapters are free with a Lably account.

More in Robotics