= Perceptron
{title2=$w\leftarrow w+yx$}
{wiki}
= Perceptron algorithm
{synonym}
A perceptron is a <binary classification> unit using an affine score $w^Tx+b$ and a threshold to predict a label. The perceptron algorithm updates that score online. Absorb the bias into an augmented constant input, use labels $y_i\in\{-1,1\}$, and start at $w=0$. Whenever $y_iw^Tx_i\leq0$, including a tie, update
$$
w\leftarrow w+y_ix_i.
$$
For a finite <linearly separable> dataset, suppose a unit vector $u$ satisfies $y_iu^Tx_i\geq\gamma>0$ and $\|x_i\|\leq R$. After $M$ updates, $u^Tw\geq M\gamma$, while expanding the squared norm at each update gives $\|w\|^2\leq MR^2$. The <Cauchy-Schwarz inequality> yields $M\gamma\leq R\sqrt M$, hence $M\leq(R/\gamma)^2$. Cycling through the dataset therefore finds a separator after finitely many updates.
The assumption matters: nonseparable data can keep generating updates. The method finds a separating <hyperplane> when the assumptions hold, rather than necessarily maximizing its margin as a <support vector machine> aims to do. A single perceptron also differs from a <multilayer perceptron>, whose hidden <activation functions> can represent nonlinear decision regions.
Back to article page