Classification: how a machine assigns an object to a class
Regression predicts a number. But often you need to predict a category: spam or not spam, sick or healthy, will the customer churn or stay. That is classification. Before counting errors, let's understand the principle itself β how a machine decides which class an object belongs to at all. Move the sliders and watch the line divide the classes.
Tune the slope and the shift so the line separates the classes with the fewest errors. That is what a classifier does β searches for a hyperplane in feature space.
To a model, any object is a set of numeric features. An email is described by, say, two features: the share of links in the text (horizontal) and how many words like "urgent", "money", "prize" it contains (vertical). Each point is one email. Teal β spam, gray β regular: you can see the spam is shifted up and to the right.
Picking good features is half the battle. For an email it is the share of links and the "spam words"; for customer churn β recency of the last purchase, visit frequency, average order value; for anti-fraud β amount, time, geography of the transaction. A model is exactly as strong as the features it was given are informative.
The threshold is a separate knob, turned after training, to match the cost of errors. The same model with different thresholds behaves as a "cautious" or a "picky" filter.
Classifiers are everywhere: spam filters, bank anti-fraud, medical diagnostics, credit scoring, content moderation, "will buy / won't buy" recommendations. Everywhere the object is described by features, and the model draws a boundary.
Modern neural networks are more intricate than a linear boundary, but the principle holds: features in, class scores out, and the decision comes from a threshold.