What is the perceptron learning rule for labels yi∈{−1,+1}, and how does one update move the prediction in the right direction?

Supervised learning, Perceptron
Level L1 Beginner. Length Short. Nature Th+Mat Both.

What's being asked

Whether you can state the mistake-driven perceptron update and explain intuitively why it nudges the boundary towards fixing a misclassified point.

Key idea

Predict y^=sign⁡(w⊤x+b), where w is the weight vector, b is the bias (offset) and sign⁡ returns +1 or −1. On a mistake, set w←w+η yixi and b←b+η yi with learning rate η>0, nudging the score towards the true label.

Steps

  1. Write the prediction rule: for an input x, compute the score w⊤x+b and predict +1 if it is positive or −1 if it is negative.
  2. Check each training point (xi,yi): if yi(w⊤xi+b)>0, the predicted sign matches yi, so nothing changes.
  3. If yi(w⊤xi+b)≤0, it is a mistake. Update w←w+η yixi and b←b+η yi, where η>0 is the step size (learning rate, often 1).
  4. Explain why it helps: if a +1 point got a negative score, adding ηxi tilts w closer to xi and raises b, so the score rises; if a −1 point was mistaken, subtracting ηxi and η lowers the score. Stop after a full pass with no mistakes (possible only when a straight line or plane can separate the classes); running this rule on numbers comes next.

Common mistakes

How long your answer should be

4–5 sentences with the update equation.

Read this

Previous in Supervised learning: What is a kernel density estimate (Parzen window estimate), and what does the bandwidth h control? Why is the method called non-parametric?
Next in Supervised learning: Why should you standardise the features before fitting ridge or lasso regression, but not necessarily before ordinary least squares?