scikit-learn/scikit-learn — pull request #595 by mblondel (2012-01-28 18:02:38+00:00)
Title: MRG: Perceptron

Here's an implementation of the good old linear Perceptron. It supports:

- dense and sparse data

- fit and partial_fit

- warm_start

...

Actually, I cheated. Here's what I did:

- modify `sgd_fast` to allow disabling regularization

- add a threshold option to the hinge loss (by changing the threshold from 1 to 0 we get the Perceptron instead of SVM)

- add a class `Perceptron` which basically just inherits from `SGDClassifier` and sets the right options

When we implement averaging or multi-class hinge in sgd, we should get the average perceptron and the multi-class perceptron for free.