Build a Simple Classifier
Explore how to build a simple linear classifier by training it to distinguish ladybugs from caterpillars based on width and length. Understand the role of slope in the dividing line and how to adjust it algorithmically using example data, setting the foundation for neural network training.
We'll cover the following...
Linear classifier
We want to train our linear classifier to correctly classify bugs as ladybugs or caterpillars. As we saw before, this is simply about refining the slope of the dividing line that separates the two groups of points on a plot showing width and height.
Rather than developing a mathematical theory upfront, let’s try to get a feel for what we need to do by trying to do it. We’ll understand the mathematics better that way. We do need some examples to learn from. The following table shows two simple examples.
| Example | Width | Length | Bug |
|---|---|---|---|
| 1 | 3.0 | 1.0 | Ladybug |
| 2 | 1.0 | 3.0 | Caterpillar |
We have one example of a bug that has a width of and a length of , which we know is a ladybug. We also have an example of a bug that is ...