July 2017
Intermediate to advanced
254 pages
6h 29m
English
Like other estimators, the Perceptron class implements fit and predict methods and hyperparameters are specified through its constructor. Perceptron also implements a partial_fit method, which allows the classifier to be trained incrementally.
In this example, we train a perceptron to classify documents from the 20 Newsgroups dataset. The dataset consists of approximately 20,000 documents sampled from 20 Usenet newsgroups. The dataset is commonly used in document classification and clustering experiments; scikit-learn even provides a convenience function for downloading and reading the dataset. We will train a perceptron to classify documents from three newsgroups: rec.sports.hockey, rec.sports.baseball ...
Read now
Unlock full access