You can skip this and continue with the next lesson. It is here for readers who want to see why the algorithm is guaranteed to stop. The result is usually credited to Albert Novikoff (1962) and also appears in Minsky and Papert's book.
The worry from the previous lesson: correcting one example can upset another. Could the weights keep bouncing forever? If the data is linearly separable, no. The proof is short.
Setting up
To keep the algebra simple, use labels for positive and for negative examples. Then both update rules become a single one: on a mistake, .
A mistake means . For a positive example that is , and for a negative one it is . (The zero case is included, because a score of exactly 0 counts as positive.)
Assume the data is separable with some margin:
- there is a unit-length vector and a number with for every example, and
- every example has length at most : .
Start from and let be the weights after corrections.
Two inequalities
1. The weights line up with . Each correction changes the overlap with by
After corrections, .
2. The weights cannot grow too fast. Since the last example was a mistake, , so
After corrections, .
Putting them together
Because has length 1, . So
which gives
The number of corrections is bounded. After at most corrections there are no more mistakes, which means a full pass is clean. That is convergence.
What the bound tells you
- Bigger margin, faster learning. If the classes are well separated (large ), few corrections are needed. A thin gap between classes means many.
- The bound does not depend on the number of features or examples, only on and .
- Random initial weights change the constant but not the conclusion.
The proof needs to exist. If the data is not linearly separable, such as XOR, the algorithm never finds a clean pass. It keeps making corrections forever.