The Huber loss with threshold has derivative equal to minus the clipped residual, where , so the optimal constant fit satisfies . When fitting a constant to , what does squared loss give, verify that satisfies the Huber condition for , and compare it with the mean and median?
Supervised learning, Robust regression
Level L2 Elementary. Length Short. Nature Th+Mat Both.
What's being asked
Whether you can check the Huber constant fit with the clipped-residual rule and explain why one outlier cannot drag it like squared loss does.
Key idea
Squared loss is minimised by the mean, which a single outlier pulls strongly. Under Huber loss, each residual is clipped to , so any outlier has influence at most in the optimality condition .
Steps
- Squared loss: the minimiser is the sample mean, . The single outlier pulls the fit far away from the other four points.
- For and , compute the residuals : they are .
- Clip each residual to : becomes . Their sum is , confirming that is the Huber fit.
- Compare with the mean and median: here matches the median () instead of the mean (), because the outlier contributes at most instead of . Near Huber acts like squared loss, and in the tails like absolute loss; deriving this clipped derivative and convexity comes next.
Common mistakes
- Clipping the loss instead of the gradient. The loss itself keeps growing linearly; only its derivative is bounded.
- Saying the Huber fit always equals the median. That holds here only because the clipped residuals happen to balance at ; with different data the answer lies between the median and the mean.
- Using the wrong residual sign, instead of , and so getting a sign error in the condition.
How long your answer should be
4–6 lines; under 2 minutes.
Read this
Previous in Supervised learning: In stacking, a meta-learner is trained on the predictions of base models. Why must the meta-features be out-of-fold predictions, and how are they produced with 5-fold cross-validation for 3 base models? What goes wrong if you use the base models' predictions on their own training data?
Next in Supervised learning: A linear regression model predicts monthly rent, in thousands of rupees, as , where is the flat's area in square feet and is the number of bedrooms. (a) What rent does it predict for a 600 sq ft flat with 2 bedrooms? (b) What does the number 3 mean? (c) Two flats both have 2 bedrooms but one is 100 sq ft larger. How much more rent does the model predict for it?