Why does an SVM use hinge loss instead of the 0-1 loss during optimisation?

Quick Overview

Asks why support vector machines train with hinge loss when the goal is to minimize classification errors. It tests whether you understand surrogate losses, convexity, the margin, support vector sparsity, and what hinge loss gives up compared with logistic loss.

Why does an SVM use hinge loss instead of the 0-1 loss during optimisation?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: medium

Interview Round: Other

Why does an SVM use hinge loss instead of the 0-1 loss during optimisation? ```hint Look at the shape of each loss Plot both losses as a function of the margin $m = y f(x)$. Ask what an optimizer can learn from the gradient of each one, and how each treats a point that is classified correctly but sits close to the boundary. ``` ### What a Strong Answer Covers - Why the 0-1 loss is hard to optimize directly, in terms of gradients, convexity and computational hardness - The properties of hinge loss that make the SVM problem tractable, including its relation to the 0-1 loss - How hinge loss produces the margin and sparse support vectors - What is given up compared with other surrogates such as the logistic loss ### Follow-up Questions - How would you get probability estimates out of a trained SVM? - What changes if you use the squared hinge loss instead? - How does hinge loss behave with mislabeled points far on the wrong side of the boundary, and what alternatives exist?

Overview: Asks why support vector machines train with hinge loss when the goal is to minimize classification errors. It tests whether you understand surrogate losses, convexity, the margin, support vector sparsity, and what hinge loss gives up compared with logistic loss.

Nov 25, 2026
mediumMachine Learning EngineerOtherMachine Learning
0
0

Why does an SVM use hinge loss instead of the 0-1 loss during optimisation?

What a Strong Answer Covers Guidance

  • Why the 0-1 loss is hard to optimize directly, in terms of gradients, convexity and computational hardness
  • The properties of hinge loss that make the SVM problem tractable, including its relation to the 0-1 loss
  • How hinge loss produces the margin and sparse support vectors
  • What is given up compared with other surrogates such as the logistic loss

Follow-up Questions Guidance

  • How would you get probability estimates out of a trained SVM?
  • What changes if you use the squared hinge loss instead?
  • How does hinge loss behave with mislabeled points far on the wrong side of the boundary, and what alternatives exist?