Search code examples
python-2.7machine-learningscikit-learnclassificationperceptron

scikit learn averaged perceptron classifier


I am a new learner to machine learning and I want to do a 2-class classification with only a few attributes. I have learned by researching online that two-class averaged perceptron algorithm is good for two-class classification with a linear model.

However, I have been reading through the documentation of Scikit-learn, and I am a bit confused if Scikit-learn is providing a averaged perceptron algorithm.

I wonder if the sklearn.linear_model.Perceptron class can be implemented as the two-class averaged perceptron algorithm by setting up the parameters correctly.

I appreciate it very much for your kind help.


Solution

  • I'm sure someone will correct me if I'm wrong but I do not believe Averaged Perceptron is implemented in sklearn. If I recall correctly, Perceptron in sklearn is simply SGD with certain default parameters.

    With that said, have you tried good old logistic regression? While it may not be the sexiest algorithm around, it often does provide good results and can serve as a baseline to see if you need to explore more complicated methods.