The Huber loss with threshold is for and otherwise, where is the residual. How do you derive , show that is convex, and use this to show that the optimal constant for the data with is ?
Supervised learning, Robust regression
Level L3 Intermediate. Length Medium. Nature Mat Mathematical.
What's being asked
Whether you can differentiate a piecewise loss, argue convexity from a monotone derivative, and turn that into a global optimality check.
Key idea
, the residual clipped to . It is continuous and non-decreasing, so is convex. For a constant fit, , so any with is a global minimiser.
Steps
- This is the harder follow-up to `huber-loss-constant-fit-outlier`, which comes first. Differentiate each piece. For : . For : , so . For : . This is .
- Check that the pieces join smoothly. At the values agree, , and the slopes agree, both equal to . So is differentiable everywhere.
- Convexity: equals in the middle and is flat outside, so it never decreases as grows. A differentiable function whose derivative is non-decreasing is convex, so any stationary point is a global minimum.
- Constant fit: with residual , the chain rule gives . Set it to zero: . is non-increasing in .
- Test with . Residuals clip to , and the sum is . Nearby, and , so crosses zero at and this is the minimiser.
- Contrast with squared loss. The mean gives , so it is not the Huber optimum. The outlier can add at most to , so it cannot drag far.
Common mistakes
- Saying the derivative is everywhere. Outside it is the constant , which is exactly why outliers have bounded influence.
- Forgetting the sign: because enters with a minus sign.
- Claiming the answer is always the median. Here happens to be the median, but in general the Huber estimate depends on : it approaches the median as and the mean as .
How long your answer should be
Half a page, about 4 minutes.
Read this
Previous in Supervised learning: Two classes have one-dimensional Gaussian class-conditional densities with the same variance , means and priors , . What is the Bayes decision boundary (derive it), and what is it for , , , , , and which class is predicted at ?
Next in Supervised learning: You want an ensemble of linear SVMs. What are two different ways to get different linear SVMs from one training set, why does each make the SVMs differ, and why must the ensemble combine their votes rather than average their real-valued scores?