shark::ROC Class Reference

ROC-Curve - false negatives over false positives. More...

#include <shark/Statistics/ROC.h>

Public Member Functions

template<class InputType >
 ROC (AbstractModel< InputType, RealVector > &model, LabeledData< InputType, unsigned int > const &set)
 
SHARK_EXPORT_SYMBOL double threshold (double falseAcceptanceRate) const
 
SHARK_EXPORT_SYMBOL double value (double falseAcceptanceRate) const
 
SHARK_EXPORT_SYMBOL double equalErrorRate () const
 Computes the equal error rate of the classifier. More...
 

Protected Attributes

std::vector< double > m_scorePositive
 scores of the positive examples More...
 
std::vector< double > m_scoreNegative
 scores of the negative examples More...
 

Detailed Description

ROC-Curve - false negatives over false positives.

This class provides the ROC curve of a classifier. All time consuming computations are done in the constructor, such that afterwards fast access to specific values of the curve and the equal error rate is possible.
The ROC class assumes a one dimensional target array and a model producing one dimensional output data. The targets must be the labels 0 and 1 of a binary classification task. The model output is assumed not to be 0 and 1, but real valued instead. Classification in done by thresholding, where different false positive and false negative rates correspond to different thresholds. The ROC curve shows the trade off between the two error types.

Definition at line 64 of file ROC.h.

Constructor & Destructor Documentation

◆ ROC()

template<class InputType >
shark::ROC::ROC ( AbstractModel< InputType, RealVector > &  model,
LabeledData< InputType, unsigned int > const &  set 
)
inline

Constructor

Parameters
modelmodel to use for prediction
setdata set with inputs and corresponding binary outputs (0 or 1)

Definition at line 72 of file ROC.h.

References shark::classSizes(), equalErrorRate(), m_scoreNegative, m_scorePositive, SHARK_EXPORT_SYMBOL, SIZE_CHECK, threshold(), and value().

Member Function Documentation

◆ equalErrorRate()

SHARK_EXPORT_SYMBOL double shark::ROC::equalErrorRate ( ) const

Computes the equal error rate of the classifier.

Referenced by ROC().

◆ threshold()

SHARK_EXPORT_SYMBOL double shark::ROC::threshold ( double  falseAcceptanceRate) const

Compute the threshold for given false acceptance rate, that is, for a given false positive rate. This threshold, used for classification with the underlying model, results in the given false acceptance rate.

Referenced by ROC().

◆ value()

SHARK_EXPORT_SYMBOL double shark::ROC::value ( double  falseAcceptanceRate) const

Value of the ROC curve for given false acceptance rate, that is, for a given false positive rate.

Referenced by ROC().

Member Data Documentation

◆ m_scoreNegative

std::vector<double> shark::ROC::m_scoreNegative
protected

scores of the negative examples

Definition at line 128 of file ROC.h.

Referenced by ROC().

◆ m_scorePositive

std::vector<double> shark::ROC::m_scorePositive
protected

scores of the positive examples

Definition at line 125 of file ROC.h.

Referenced by ROC().


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