shark::NegativeWilcoxonMannWhitneyStatistic< LabelType, OutputType > Class Template Reference

Negative Wilcoxon-Mann-Whitney statistic. More...

#include <shark/ObjectiveFunctions/NegativeAUC.h>

+ Inheritance diagram for shark::NegativeWilcoxonMannWhitneyStatistic< LabelType, OutputType >:

Public Member Functions

 NegativeWilcoxonMannWhitneyStatistic (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 Wilcoxon-Mann-Whitney statistic. More...
 
double eval (Data< LabelType > const &target, Data< OutputType > const &prediction) const
 
- Public Member Functions inherited from shark::AbstractCost< LabelType, OutputType >
virtual ~AbstractCost ()
 
const Featuresfeatures () 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 ()
 

Additional Inherited Members

- 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< FeatureFeatures
 
typedef TypedFeatureNotAvailableException< FeatureFeatureNotAvailableException
 
- Protected Attributes inherited from shark::AbstractCost< LabelType, OutputType >
Features m_features
 

Detailed Description

template<class LabelType = unsigned int, class OutputType = LabelType>
class shark::NegativeWilcoxonMannWhitneyStatistic< LabelType, OutputType >

Negative Wilcoxon-Mann-Whitney statistic.

This class computes the Wilcoxon-Mann-Whitney statistic, which is an unbiased estimate of the area under the ROC curve.

See, for example: Corinna Cortes, Mehryar Mohri. Confidence Intervals for the Area under the ROC Curve. NIPS, 2004

The area is negated so that optimizing the AUC corresponds to a minimization task.

Definition at line 164 of file NegativeAUC.h.

Constructor & Destructor Documentation

◆ NegativeWilcoxonMannWhitneyStatistic()

template<class LabelType = unsigned int, class OutputType = LabelType>
shark::NegativeWilcoxonMannWhitneyStatistic< LabelType, OutputType >::NegativeWilcoxonMannWhitneyStatistic ( bool  invert = false)
inline

Constructor.

Parameters
invertif set to true, the role of positive and negative class are switched

Definition at line 169 of file NegativeAUC.h.

References shark::NegativeAUC< LabelType, OutputType >::m_invert.

Member Function Documentation

◆ eval() [1/2]

template<class LabelType = unsigned int, class OutputType = LabelType>
double shark::NegativeWilcoxonMannWhitneyStatistic< LabelType, OutputType >::eval ( Data< LabelType > const &  target,
Data< OutputType > const &  prediction,
unsigned int  column 
) const
inline

Computes Wilcoxon-Mann-Whitney statistic.

Parameters
targetinterpreted as binary class label
predictioninterpreted as binary class label
columnindicates the column of the prediction vector interpreted as probability of positive class

Definition at line 181 of file NegativeAUC.h.

◆ eval() [2/2]

template<class LabelType = unsigned int, class OutputType = LabelType>
double shark::NegativeWilcoxonMannWhitneyStatistic< LabelType, OutputType >::eval ( Data< LabelType > const &  targets,
Data< OutputType > const &  predictions 
) const
inlinevirtual

Evaluates the cost of predictions, given targets.

Parameters
targetstarget values
predictionspredictions, typically made by a model

Implements shark::AbstractCost< LabelType, OutputType >.

Definition at line 230 of file NegativeAUC.h.

References shark::dataDimension(), shark::NegativeAUC< LabelType, OutputType >::eval(), shark::NegativeAUC< LabelType, OutputType >::m_invert, shark::Data< Type >::numberOfElements(), and SHARK_RUNTIME_CHECK.

◆ name()

template<class LabelType = unsigned int, class OutputType = LabelType>
std::string shark::NegativeWilcoxonMannWhitneyStatistic< LabelType, OutputType >::name ( ) const
inlinevirtual

From INameable: return the class name.

Reimplemented from shark::INameable.

Definition at line 174 of file NegativeAUC.h.


The documentation for this class was generated from the following file: