In plain words, what does the hinge loss punish in a classifier, and what is the loss for a point with correct label when the model's score for it is ?
Supervised learning, Hinge loss
Level L1 Beginner. Length Short. Nature Th+Mat Both.
What's being asked
Whether you see that hinge loss asks for a safety margin, not just the right sign, and can apply the rule once.
Key idea
The classifier gives each point a score. For a label or , the margin is : positive when the point is on the correct side, larger when it is further from the boundary. Hinge loss is : zero once the margin is at least 1, and growing steadily as the margin falls below 1.
Steps
- Think of the score as a confidence. Multiply it by the true label ( or ) to get the margin . A positive margin means the point is on the correct side.
- Hinge loss is . A point that is correct with room to spare () costs nothing. A point that is right but too close to the boundary () is still charged a little. A wrong point () is charged more than 1.
- Our example: and score give , so the loss is . The point is on the correct side but not by enough, so it is still charged.
- This "safety margin" idea is why hinge loss is used to train support vector machines (SVMs): they want points far from the boundary, not merely on the right side.
Common mistakes
- Thinking that a correctly classified point always has zero hinge loss. It is zero only when the margin is at least 1.
- Forgetting to multiply by the label. For a negative score is the correct side, so the margin is positive.
How long your answer should be
3–4 sentences, about 1 minute.
Read this
Previous in Supervised learning: What is the difference between bagging and boosting, in one sentence?
Next in Supervised learning: In a soft-margin support vector machine (SVM), what does the hyperparameter control?