Negative area under the curve. More...
#include <shark/ObjectiveFunctions/NegativeAUC.h>
 Inheritance diagram for shark::NegativeAUC< LabelType, OutputType >:
 Inheritance diagram for shark::NegativeAUC< LabelType, OutputType >:| Public Types | |
| typedef KeyValuePair< double, LabelType > | AUCPair | 
|  Public Types inherited from shark::AbstractCost< LabelT, OutputT > | |
| enum | Feature { HAS_FIRST_DERIVATIVE = 1 , HAS_SECOND_DERIVATIVE = 2 , IS_LOSS_FUNCTION = 4 } | 
| list of features a cost function can have  More... | |
| typedef OutputT | OutputType | 
| typedef LabelT | LabelType | 
| typedef Batch< OutputType >::type | BatchOutputType | 
| typedef Batch< LabelType >::type | BatchLabelType | 
| typedef TypedFlags< Feature > | Features | 
| typedef TypedFeatureNotAvailableException< Feature > | FeatureNotAvailableException | 
| Public Member Functions | |
| NegativeAUC (bool invert=false) | |
| std::string | name () const | 
| From INameable: return the class name. | |
| double | eval (Data< LabelType > const &target, Data< OutputType > const &prediction, unsigned int column) const | 
| Computes area under the curve. | |
| double | eval (Data< LabelType > const &target, Data< OutputType > const &prediction) const | 
| Computes area under the curve. If the prediction vector is 1-dimensional, the "positive" class is mapped to larger values. If the prediction vector is 2-dimensional, the second dimension is viewed as the "positive" class. For higher dimensional vectors, an exception is thrown. In such a case, the column has to be explicitly specified as an additional parameter. | |
|  Public Member Functions inherited from shark::AbstractCost< LabelT, OutputT > | |
| 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 | |
| double | operator() (Data< LabelType > const &targets, Data< OutputType > const &predictions) const | 
|  Public Member Functions inherited from shark::INameable | |
| virtual | ~INameable () | 
| Protected Member Functions | |
| double | trapArea (double x1, double x2, double y1, double y2) const | 
| Protected Attributes | |
| bool | m_invert | 
|  Protected Attributes inherited from shark::AbstractCost< LabelT, OutputT > | |
| Features | m_features | 
Negative area under the curve.
This class computes the area under the ROC (receiver operating characteristic) curve. It implements the algorithm described in: Tom Fawcett. ROC Graphs: Notes and Practical Considerations for Researchers. 2004
The area is negated so that optimizing the AUC corresponds to a minimization task.
Definition at line 52 of file NegativeAUC.h.
| typedef KeyValuePair< double, LabelType > shark::NegativeAUC< LabelType, OutputType >::AUCPair | 
Definition at line 55 of file NegativeAUC.h.
| 
 | inline | 
Constructor.
| invert | if set to true, the role of positive and negative class are switched | 
Definition at line 59 of file NegativeAUC.h.
References shark::NegativeAUC< LabelType, OutputType >::m_invert.
| 
 | inlinevirtual | 
Computes area under the curve. If the prediction vector is 1-dimensional, the "positive" class is mapped to larger values. If the prediction vector is 2-dimensional, the second dimension is viewed as the "positive" class. For higher dimensional vectors, an exception is thrown. In such a case, the column has to be explicitly specified as an additional parameter.
| target | class label, 0 or 1 | 
| prediction | prediction by classifier, OutputType-valued vector | 
Implements shark::AbstractCost< LabelT, OutputT >.
Definition at line 130 of file NegativeAUC.h.
References shark::dataDimension(), shark::NegativeAUC< LabelType, OutputType >::eval(), shark::Data< Type >::numberOfElements(), and SHARK_RUNTIME_CHECK.
| 
 | inline | 
Computes area under the curve.
| target | class label, 0 or 1 | 
| prediction | prediction by classifier, OutputType-valued vector | 
| column | indicates the column of the prediction vector interpreted as probability of positive class | 
Definition at line 71 of file NegativeAUC.h.
References shark::dataDimension(), shark::Data< Type >::element(), shark::NegativeAUC< LabelType, OutputType >::m_invert, shark::Data< Type >::numberOfElements(), SHARK_RUNTIME_CHECK, and shark::NegativeAUC< LabelType, OutputType >::trapArea().
Referenced by shark::NegativeAUC< LabelType, OutputType >::eval().
| 
 | inlinevirtual | 
From INameable: return the class name.
Reimplemented from shark::INameable.
Definition at line 64 of file NegativeAUC.h.
| 
 | inlineprotected | 
Definition at line 143 of file NegativeAUC.h.
Referenced by shark::NegativeAUC< LabelType, OutputType >::eval().
| 
 | protected | 
Definition at line 149 of file NegativeAUC.h.
Referenced by shark::NegativeAUC< LabelType, OutputType >::eval(), and shark::NegativeAUC< LabelType, OutputType >::NegativeAUC().