liveBook · Manning

Huber loss

As explained in Ensemble Methods for Machine Learning

Huber loss is a piecewise regression loss that is quadratic for small errors and linear for errors beyond a threshold.

Huber loss balances two regression priorities: it treats small residuals like squared error, but limits the influence of large residuals by switching to scaled absolute error beyond a user-selected threshold τ. It therefore offers more outlier resistance than squared error while retaining smooth behavior near zero. section 7.3.1

Use the loss by reasoning through its threshold and optimization requirements:

  • Choose τ to determine where the loss changes from squared-error behavior to absolute-error behavior. section 7.3.1
  • Prefer Huber loss when extreme residuals should not dominate regression training. section 7.3.1
  • Use pseudo-Huber for Newton boosting, because ordinary Huber loss includes an absolute-error component and is not twice differentiable. section 7.3.1

Gradient-boosted regression

For AutoMPG regression, LightGBM can use objective='huber' with alpha controlling the switching threshold. Randomized search and five-fold cross-validation tune alpha alongside learning rate, tree depth, subsampling, and regularization; early stopping can terminate unproductive training. XGBoost instead uses objective='reg:pseudohubererror'. section 7.3.2

How Ensemble Methods for Machine Learning covers it

How deep it goes
Explains the thresholded loss behavior, differentiability constraint, pseudo-Huber alternative, and practical boosting configuration.
Examples
Demonstrates AutoMPG regression with LightGBM Huber loss and XGBoost pseudo-Huber loss.
What it assumes
Assumes regression residuals, squared error, absolute error, gradient boosting, and second derivatives.
What you can do after
Apply it via LightGBM, tune its threshold with randomized search and cross-validation, or substitute pseudo-Huber in XGBoost.
How it connects
Connects squared error, absolute error, gradient boosting, Newton boosting, and pseudo-Huber loss.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Ensemble Methods for Machine Learning. The section links point to the parts of the book it draws on.