yat  0.13.2pre
Public Member Functions | Protected Attributes | Friends | List of all members
theplu::yat::statistics::AUC Class Reference

Area Under ROC Curve. More...

#include <yat/statistics/AUC.h>

Inheritance diagram for theplu::yat::statistics::AUC:
theplu::yat::statistics::Score

Public Member Functions

 AUC (bool absolute=true)
 Default Constructor. More...
 
double score (const classifier::Target &target, const utility::VectorBase &value) const
 
double score (const classifier::Target &target, const classifier::DataLookupWeighted1D &value) const
 
double score (const classifier::Target &target, const utility::VectorBase &value, const utility::VectorBase &weight) const
 
void absolute (bool absolute)
 Function changing mode of Score.
 
virtual double score (const classifier::Target &target, const classifier::DataLookup1D &value) const
 
double score (const classifier::Target &target, const classifier::DataLookup1D &value, const classifier::DataLookup1D &weight) const
 

Protected Attributes

bool absolute_
 

Friends

class ROC
 

Detailed Description

Area Under ROC Curve.

Class calculates area under curve from values, Target, and possibly weights. If weights are left out, unity weights are assumed. The area under curve is defined as

\[ \frac{\sum_{i,j} I(x_i^+-x_j^-) w_i^+w_j^-} {\sum_{i,j} w_i^+w_j^-} \]

where

\begin{eqnarray*} &0; &x<0 \\ I(x) = &0.5; &x=0 \\ &1; &x>0 \end{eqnarray*}

Complexity of calculating the AUC is $ N \log N $.

Constructor & Destructor Documentation

theplu::yat::statistics::AUC::AUC ( bool  absolute = true)

Default Constructor.

Parameters
absoluteif true max(AUC, 1-AUC) is used

Member Function Documentation

double theplu::yat::statistics::AUC::score ( const classifier::Target target,
const utility::VectorBase value 
) const
virtual
Returns
area under the ROC curve.

Implements theplu::yat::statistics::Score.

double theplu::yat::statistics::AUC::score ( const classifier::Target target,
const classifier::DataLookupWeighted1D value 
) const
virtual
Returns
area under the ROC curve.

Reimplemented from theplu::yat::statistics::Score.

virtual double theplu::yat::statistics::Score::score ( const classifier::Target target,
const classifier::DataLookup1D value 
) const
virtualinherited

Function calculating the score. In absolute mode, also the score using negated class labels is calculated, and the largest of the two scores are calculated.

value is copied to a utility::vector and that operator is called. If speed is important this operator should be implemented in inherited class to avoid copying.

Returns
score
double theplu::yat::statistics::AUC::score ( const classifier::Target target,
const utility::VectorBase value,
const utility::VectorBase weight 
) const
virtual
Returns
area under the ROC curve.

Implements theplu::yat::statistics::Score.

double theplu::yat::statistics::Score::score ( const classifier::Target target,
const classifier::DataLookup1D value,
const classifier::DataLookup1D weight 
) const
inherited

Function calculating the weighted version of score. In absolute mode, also the score using negated class labels is calculated, and the largest of the two scores are calculated. Absolute mode should be used when two-tailed test is wanted.

value and weight are copied to utility::vector and the corresponding operator is called. If speed is important this operator should be implemented in inherited class to avoid copying.

Member Data Documentation

bool theplu::yat::statistics::Score::absolute_
protectedinherited

true if method is absolute, which means if score is below expected value (by chance) E, score returns E-score+E instead.


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

Generated on Wed Jan 4 2017 02:23:08 for yat by  doxygen 1.8.5