added about huber cost function

This commit is contained in:
mhjensen
2019-12-20 22:36:34 +01:00
parent 38e5126383
commit a70aa87228
8 changed files with 242 additions and 1112 deletions
+16 -1
View File
@@ -814,6 +814,14 @@ the relative error (why would we prefer the MSE instead of the relative error?)
\epsilon_{\mathrm{relative}}= \frac{\vert \hat{y} -\hat{\tilde{y}}\vert}{\vert \hat{y}\vert}.
\]
!et
The squared cost function results in an arithmetic mean-unbiased
estimator, and the absolute-value cost function results in a
median-unbiased estimator (in the one-dimensional case, and a
geometric median-unbiased estimator for the multi-dimensional
case). The squared cost function has the disadvantage that it has the tendency
to be dominated by outliers.
We can modify easily the above Python code and plot the relative error instead
!bc pycod
import numpy as np
@@ -915,7 +923,7 @@ The MAE is defined as follows
\text{MAE}(\hat{y}, \hat{\tilde{y}}) = \frac{1}{n} \sum_{i=0}^{n-1} \left| y_i - \tilde{y}_i \right|.
\]
!et
Finally we present the
We present the
squared logarithmic (quadratic) error
!bt
\[
@@ -928,6 +936,13 @@ estimate is best to use when targets having exponential growth, such
as population counts, average sales of a commodity over a span of
years etc.
Finally, another cost function is the Huber cost function used in robust regression.
It is less sensitive to outliers in data than the squared error cost function.
A variant for classification is also sometimes used, a quantity we will meet later.
We will discuss in more
detail these and other functions in the various lectures. We conclude this part with another example. Instead of
a linear $x$-dependence we study now a cubic polynomial and use the polynomial regression analysis tools of scikit-learn.