02 / FOLLOW THE QUESTION
What makes a
boundary good?
A model can make predictions. To improve them, we need a way to measure how well it is doing.
Imagine two lines dividing the same points. One makes two mistakes, the other makes six. If every mistake matters equally, counting them gives us a first measure of error: classification error.
Try moving the boundary in the first experiment. Each time the line crosses a point, that point changes class. The error count changes only at that moment. In between, it stays flat — even though the line moves.
That creates a challenge: if we want a gradient to tell us which way to move, a flat error count is not very informative. Training often uses a surrogate loss that changes smoothly with a model’s scores. Classification error can still be useful for evaluation.
INTERACTIVE EXPLORATION
Correct or confident?
The true class is A (y = 1). Move the raw score: classification error changes at zero, while log loss changes smoothly.
Which is more informative during training: knowing only whether a point is wrong, or knowing how confidently the model made its prediction?
Our example is a simple binary classifier, not a universal rule for all models. Regression, for example, uses losses for numerical predictions. The choice of loss should reflect the task.
Next questions: How do we turn a score into a probability? How do gradients help us lower a smooth loss? How well does the trained model work on unseen data?
Continue with gradient descent or generalization and overfitting, and explore other questions on the learning map.
Further reading: Google Machine Learning Crash Course — Loss ↗