What is hinge loss?

Quick Overview

Asks what hinge loss is in binary classification, how its penalty depends on the margin, and which model it is used to train. Tests understanding of convex surrogates for 0-1 loss, subgradients at non-differentiable points, and how hinge loss compares with logistic and squared loss.

What is hinge loss?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: easy

Interview Round: Other

What is hinge loss? Assume a binary classifier that outputs a real-valued score $f(x)$ and labels $y \in \{-1, +1\}$. ```hint Look at the product of label and score Write the loss as a function of $y \cdot f(x)$ and ask what it should do when that product is large and positive, small and positive, or negative. ``` ### What a Strong Answer Covers - The formula and the label convention it relies on. - How the loss behaves in each margin region: confidently correct, correct but inside the margin, and misclassified. - How it relates to 0-1 loss and why that matters for optimization. - The kink at margin 1 and how optimizers handle it. - Where it is used (the soft-margin SVM objective) and how it compares with logistic and squared loss. ### Follow-up Questions - In the SVM objective, how does the regularization strength trade margin width against hinge violations? - Why are SVM scores not calibrated probabilities, and how would you get probabilities from them? - What is the subgradient of the hinge loss for a linear model, and which training points change the weights during SGD? - How do the Crammer-Singer and Weston-Watkins multiclass hinge losses differ?

Overview: Asks what hinge loss is in binary classification, how its penalty depends on the margin, and which model it is used to train. Tests understanding of convex surrogates for 0-1 loss, subgradients at non-differentiable points, and how hinge loss compares with logistic and squared loss.

General logo
General
Nov 25, 2026
easyMachine Learning EngineerOtherMachine Learning
0
0

What is hinge loss? Assume a binary classifier that outputs a real-valued score f(x)f(x) and labels y∈{−1,+1}y \in \{-1, +1\}.

What a Strong Answer Covers Guidance

  • The formula and the label convention it relies on.
  • How the loss behaves in each margin region: confidently correct, correct but inside the margin, and misclassified.
  • How it relates to 0-1 loss and why that matters for optimization.
  • The kink at margin 1 and how optimizers handle it.
  • Where it is used (the soft-margin SVM objective) and how it compares with logistic and squared loss.

Follow-up Questions Guidance

  • In the SVM objective, how does the regularization strength trade margin width against hinge violations?
  • Why are SVM scores not calibrated probabilities, and how would you get probabilities from them?
  • What is the subgradient of the hinge loss for a linear model, and which training points change the weights during SGD?
  • How do the Crammer-Singer and Weston-Watkins multiclass hinge losses differ?