Huber Loss 是一個用於回歸問題的帶參損失函數, 優點是能增強平方誤差損失函數(MSE, mean square error)對離群點的魯棒性。
當預測偏差小於 δ 時,它采用平方誤差,
當預測偏差大於 δ 時,采用的線性誤差。
相比於最小二乘的線性回歸,HuberLoss降低了對離群點的懲罰程度,所以 HuberLoss 是一種常用的魯棒的回歸損失函數。
Huber Loss 定義如下
\[\begin{split} L_\delta(a)=\left \{ \begin{array}{ll} \frac12a^2,&\textrm{for } |a|\leq\delta,\\ \delta\cdot(|a|-\frac12\delta),&\textrm{otherwise.} \end{array} \right. \end{split} \]

參數 a 通常表示 residuals,寫作 y−f(x),當 a = y−f(x) 時,Huber loss 定義為:
\[\begin{split} L_\delta(y, f(x))=\left\{ \begin{array}{ll} \frac12(y-f(x))^2,&\textrm{for }|y-f(x)|\leq\delta\\ \delta\cdot(|y-f(x)|-\frac12\delta),&\textrm{otherwise.} \end{array} \right. \end{split} \]
δ 是 HuberLoss 的參數,y是真實值,f(x)是模型的預測值, 且由定義可知 Huber Loss 處處可導