Binary classification with the perceptron
Let's work through a toy classification problem. Suppose that you wish to separate adult cats from kittens. Only two explanatory variables are available in your dataset: the proportion of the day that the animal was asleep and the proportion of the day that the animal was grumpy. Our training data consists of the following four instances:
Instance |
Proportion of the day spent sleeping |
Proportion of the day spent being grumpy |
Kitten or Adult? |
---|---|---|---|
1 |
0.2 |
0.1 |
Kitten |
2 |
0.4 |
0.6 |
Kitten |
3 |
0.5 |
0.2 |
Kitten |
4 |
0.7 |
0.9 |
Adult |
The following scatter plot of the instances confirms that they are linearly separable:
Our goal is to train a perceptron that can classify animals using the two real-valued explanatory ...
Get scikit-learn : Machine Learning Simplified now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.