When you read about perceptron variants at Wikipedia there is explained an algorithm: [Pocket Algorithm](http://en.wikipedia.org/wiki/Perceptron#Variants) It is said that:

> 
> solves the stability problem of perceptron learning by keeping the best solution seen so far "in its pocket"
> 
> 
> 

However, there is not much explanation about the algorithm, and I would like to see some pseudocode for it, as well as an explanation of how to implement by hand.