The Huber loss with threshold δ has derivative equal to minus the clipped residual, −ψ(yi−c) where ψ(r)=max⁡(−δ,min⁡(δ,r)), so the optimal constant fit c satisfies ∑iψ(yi−c)=0. When fitting a constant c to {1,2,3,4,100}, what does squared loss give, verify that c=3 satisfies the Huber condition for δ=1.5, 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 ri=yi−c is clipped to [−δ,δ], so any outlier has influence at most δ in the optimality condition ∑iψ(yi−c)=0.

Steps

  1. Squared loss: the minimiser is the sample mean, c=(1+2+3+4+100)/5=22. The single outlier 100 pulls the fit far away from the other four points.
  2. For c=3 and δ=1.5, compute the residuals ri=yi−3: they are −2,−1,0,1,97.
  3. Clip each residual to [−1.5,1.5]: ψ(ri) becomes −1.5,−1,0,1,1.5. Their sum is −1.5−1+0+1+1.5=0, confirming that c=3 is the Huber fit.
  4. Compare with the mean and median: here c=3 matches the median (3) instead of the mean (22), because the outlier 100 contributes at most δ=1.5 instead of 97. Near 0 Huber acts like squared loss, and in the tails like absolute loss; deriving this clipped derivative and convexity comes next.

Common mistakes

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 y^=5+0.02 a+3 r, where a is the flat's area in square feet and r 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?