Tukey's Biweight-loss for robust regression. More...
#include <shark/ObjectiveFunctions/Loss/TukeyBiweightLoss.h>
Public Member Functions | |
TukeyBiweightLoss (double k=1.0) | |
constructor More... | |
std::string | name () const |
Returns class name "HuberLoss". More... | |
double | eval (BatchLabelType const &labels, BatchOutputType const &predictions) const |
calculates the sum of all More... | |
double | evalDerivative (BatchLabelType const &labels, BatchOutputType const &predictions, BatchOutputType &gradient) const |
evaluate the loss and the derivative w.r.t. the prediction More... | |
Public Member Functions inherited from shark::AbstractLoss< RealVector, RealVector > | |
AbstractLoss () | |
virtual double | eval (ConstLabelReference target, ConstOutputReference prediction) const |
evaluate the loss for a target and a prediction More... | |
double | eval (Data< LabelType > const &targets, Data< OutputType > const &predictions) const |
virtual double | evalDerivative (ConstLabelReference target, ConstOutputReference prediction, OutputType &gradient) const |
evaluate the loss and its derivative for a target and a prediction More... | |
virtual double | evalDerivative (ConstLabelReference target, ConstOutputReference prediction, OutputType &gradient, MatrixType &hessian) const |
evaluate the loss and its first and second derivative for a target and a prediction More... | |
double | operator() (LabelType const &target, OutputType const &prediction) const |
evaluate the loss for a target and a prediction More... | |
double | operator() (BatchLabelType const &target, BatchOutputType const &prediction) const |
Public Member Functions inherited from shark::AbstractCost< RealVector, RealVector > | |
virtual | ~AbstractCost () |
const Features & | features () const |
virtual void | updateFeatures () |
bool | hasFirstDerivative () const |
returns true when the first parameter derivative is implemented More... | |
bool | isLossFunction () const |
returns true when the cost function is in fact a loss function More... | |
double | operator() (Data< LabelType > const &targets, Data< OutputType > const &predictions) const |
Public Member Functions inherited from shark::INameable | |
virtual | ~INameable () |
Tukey's Biweight-loss for robust regression.
Tukey's Biweight-loss is a robust regression function. For predictions close to the correct classification, it is convex, but close to a value k, it approaches a constant value. for differences greater than k, the function is constant and has gradient 0. This effectively ignores large outliers at the cost of loosing the convexity of the loss function. The 1-dimensional loss is defined as
\[ f(x)= \frac {x^6}{6k^4} - \frac {x^4} {2k^2}+\frac {x^2} {2} \]
for \( x \in [-k,k]\). outside it is the constant function \(\frac {k^2}{6}\).
For multidimensional problems we define it with x being the two-norm of the difference between the label and predicted values.
Definition at line 50 of file TukeyBiweightLoss.h.
|
inline |
constructor
Definition at line 54 of file TukeyBiweightLoss.h.
References shark::AbstractCost< RealVector, RealVector >::m_features.
|
inlinevirtual |
calculates the sum of all
Implements shark::AbstractLoss< RealVector, RealVector >.
Definition at line 64 of file TukeyBiweightLoss.h.
References SIZE_CHECK, and shark::sqr().
|
inlinevirtual |
evaluate the loss and the derivative w.r.t. the prediction
target | target value |
prediction | prediction, typically made by a model |
gradient | the gradient of the loss function with respect to the prediction |
Reimplemented from shark::AbstractLoss< RealVector, RealVector >.
Definition at line 87 of file TukeyBiweightLoss.h.
References SIZE_CHECK, and shark::sqr().
|
inlinevirtual |
Returns class name "HuberLoss".
Reimplemented from shark::INameable.
Definition at line 59 of file TukeyBiweightLoss.h.