.. _book_fig_chapter8_fig_huber_loss: Huber Loss Function ------------------- Figure 8.8 An example of fitting a simple linear model to data which includes outliers (data is from table 1 of Hogg et al 2010). A comparison of linear regression using the squared-loss function (equivalent to ordinary least-squares regression) and the Huber loss function, with c = 1 (i.e., beyond 1 standard deviation, the loss becomes linear). .. image:: ../images/chapter8/fig_huber_loss_1.png :scale: 100 :align: center .. raw:: html
**Code output:** .. raw:: html
.. literalinclude:: fig_huber_loss.txt .. raw:: html
**Python source code:** .. raw:: html
.. literalinclude:: fig_huber_loss.py :lines: 12- .. raw:: html
:download:`[download source: fig_huber_loss.py] ` .. raw:: html