|
SHARK_EXPORT_SYMBOL | DiscreteLoss (RealMatrix const &cost) |
|
std::string | name () const |
| From INameable: return the class name.
|
|
SHARK_EXPORT_SYMBOL double | eval (BatchLabelType const &target, BatchOutputType const &prediction) const |
| inherited from AbstractLoss, evaluation of the loss function
|
|
SHARK_EXPORT_SYMBOL void | defineCostMatrix (RealMatrix const &cost) |
|
SHARK_EXPORT_SYMBOL void | defineBalancedCost (UnlabeledData< unsigned int > const &labels) |
|
| AbstractLoss () |
|
virtual double | eval (ConstLabelReference target, ConstOutputReference prediction) const |
| evaluate the loss for a target and a prediction
|
|
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
|
|
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
|
|
virtual double | evalDerivative (BatchLabelType const &target, BatchOutputType const &prediction, BatchOutputType &gradient) const |
| evaluate the loss and the derivative w.r.t. the prediction
|
|
double | operator() (LabelType const &target, OutputType const &prediction) const |
| evaluate the loss for a target and a prediction
|
|
double | operator() (BatchLabelType const &target, BatchOutputType const &prediction) const |
|
virtual | ~AbstractCost () |
|
const Features & | features () const |
|
virtual void | updateFeatures () |
|
bool | hasFirstDerivative () const |
| returns true when the first parameter derivative is implemented
|
|
bool | isLossFunction () const |
| returns true when the cost function is in fact a loss function
|
|
virtual double | eval (Data< LabelType > const &targets, Data< OutputType > const &predictions) const =0 |
|
double | operator() (Data< LabelType > const &targets, Data< OutputType > const &predictions) const |
|
virtual | ~INameable () |
|
flexible loss for classification
- The DiscreteLoss class allows for the definition of a cost matrix applied to a finite number of classes. The cost of correct classification must be zero, all other costs must be non-negative.
- Note: As a special case, this loss can be used to provide a balanced error signal for unbalanced data sets.
Definition at line 57 of file DiscreteLoss.h.