Reputation: 439
I am working with the book Deep Learning for Computer Vision with Python by Adrian Rosebrock. I am wondering why the results in scikit-learn is significantly different from the one implemented in the book. Please check the code here.
Upvotes: 0
Views: 77
Reputation: 758
From scikit-learn documentation:
The Perceptron is another simple classification algorithm suitable for large scale learning. By default:
It does not require a learning rate.
It is not regularized (penalized).
It updates its model only on mistakes.
The last characteristic implies that the Perceptron is slightly faster to train than SGD with the hinge loss and that the resulting models are sparser.
And from here
Perceptron is a classification algorithm which shares the same underlying implementation with SGDClassifier. In fact, Perceptron() is equivalent to
SGDClassifier(loss="perceptron", eta0=1, learning_rate="constant", penalty=None)
So you should compare results with SGDClassifier
by specifying the same parameters - loss function, learning rate, regularisation, random state, shuffle and etc.
Upvotes: 1