Write the hinge loss and the logistic loss as functions of the margin , where is the label and the classifier's score, and evaluate both at . What does the difference in their shapes mean for the classifiers they produce?
Supervised learning, Loss functions
Level L2 Elementary. Length Short. Nature Th+Mat Both.
What's being asked
Whether you can write both losses in terms of the margin and link their shapes to support vectors and probability outputs.
Key idea
The margin is positive when the prediction is correct and larger when it is more confident. Hinge loss is exactly zero once ; logistic loss is positive for every . So an SVM ignores confidently correct points, while logistic regression uses every point and gives probabilities .
Steps
- Write both losses in terms of and sketch them next to the zero-one loss , which is 1 for a mistake and 0 otherwise.
- Fill in the table. Hinge gives . Logistic gives , , and .
- Note what they share. Both are convex (bowl-shaped, so there are no bad local minima) and grow only linearly for very wrong points, so outliers hurt less than with squared loss.
- Hinge: the loss and its slope are zero for . So only points with , the support vectors, affect the solution.
- Logistic: smooth and never exactly zero. So every point has some influence, and the score can be read as a probability, .
Common mistakes
- Claiming the natural-log logistic loss is always above the zero-one loss. At it is ; you need for that bound.
- Saying an SVM outputs probabilities. It needs a separate calibration step, such as Platt scaling.
How long your answer should be
3–5 sentences plus the table of values.
Last checked on 4 December 2026.
Read this
- The Elements of Statistical Learning (ESL): Free PDF. Section 10.6 (Loss Functions and Robustness), Figure 10.4, p. 346: hinge, binomial deviance, exponential and 0-1 loss plotted against the margin y*f; Section 12.3.2 (The SVM as a Penalization Method), Figure 12.4 and Table 12.1, pp. 426-427, compares the SVM hinge loss with the logistic loss.
- Cornell CS4780 Lecture Notes (Weinberger): Empirical Risk Minimization: Table of classification losses (hinge, log-loss, exponential, zero-one) as functions of h(x)y, with notes on which are differentiable and what each is used for.
- NPTEL: Introduction to Machine Learning (IIT Madras, Prof. Balaraman Ravindran): Week 4, Hingle Loss formulation of SVM Objective, which writes the SVM as hinge-loss minimisation.
Previous in Supervised learning: A node holds 16 samples, 8 positive and 8 negative. Split sends 6 samples (5 positive, 1 negative) left and 10 samples (3 positive, 7 negative) right. Split sends 8 samples (6 positive, 2 negative) left and 8 samples (2 positive, 6 negative) right. What is the information gain (using base-2 entropy) of each split, and which split is chosen?
Next in Supervised learning: A feature has class-conditional densities for class and for class , with priors and . For equal-variance 1-D Gaussians, the Bayes decision boundary is . What is , which class is predicted for , and how does the unequal prior shift the boundary?