Negative area under the curve. More...
#include <shark/ObjectiveFunctions/NegativeAUC.h>
Public Types | |
typedef KeyValuePair< double, LabelType > | AUCPair |
Public Types inherited from shark::AbstractCost< LabelType, OutputType > | |
enum | Feature |
list of features a cost function can have More... | |
typedef OutputType | OutputType |
typedef LabelType | 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. More... | |
double | eval (Data< LabelType > const &target, Data< OutputType > const &prediction, unsigned int column) const |
Computes area under the curve. More... | |
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. More... | |
Public Member Functions inherited from shark::AbstractCost< LabelType, OutputType > | |
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 () |
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< LabelType, OutputType > | |
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.
|
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.
Referenced by shark::NegativeAUC< LabelType, OutputType >::eval(), and shark::NegativeWilcoxonMannWhitneyStatistic< LabelType, OutputType >::eval().
|
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< LabelType, OutputType >.
Definition at line 130 of file NegativeAUC.h.
References shark::dataDimension(), shark::NegativeAUC< LabelType, OutputType >::eval(), shark::Data< Type >::numberOfElements(), and SHARK_RUNTIME_CHECK.
|
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.
|
protected |
Definition at line 149 of file NegativeAUC.h.
Referenced by shark::NegativeWilcoxonMannWhitneyStatistic< LabelType, OutputType >::eval(), shark::NegativeAUC< LabelType, OutputType >::NegativeAUC(), and shark::NegativeWilcoxonMannWhitneyStatistic< LabelType, OutputType >::NegativeWilcoxonMannWhitneyStatistic().