Recall< AS, PositiveClass > Class Template Reference

Recall is a metric of performance for classification algorithms that for binary classification is equal to $ tp / (tp + fn) $, where $ tp $ and $ fn $ are the numbers of true positives and false negatives respectively. More...

Static Public Member Functions

template
<
typename
MLAlgorithm
,
typename
DataType
>
static double Evaluate (MLAlgorithm &model, const DataType &data, const arma::Row< size_t > &labels)
 Run classification and calculate recall. More...

 

Static Public Attributes

static const bool NeedsMinimization = false
 Information for hyper-parameter tuning code. More...

 

Detailed Description


template<AverageStrategy AS, size_t PositiveClass = 1>
class mlpack::cv::Recall< AS, PositiveClass >

Recall is a metric of performance for classification algorithms that for binary classification is equal to $ tp / (tp + fn) $, where $ tp $ and $ fn $ are the numbers of true positives and false negatives respectively.

For multiclass classification the recall metric can be used with the following strategies for averaging.

  1. Micro. If there are $ N + 1 $ classes in total, the result is equal to

    \[ (tp_0 + tp_1 + \ldots + tp_N) / (tp_0 + tp_1 + \ldots + tp_N + fn_0 + fn_1 + \ldots + fn_N), \]

    where $ tp_i $ and $ fn_i $ are the numbers of true positives and false negatives respectively for the class (label) $ i $.
  2. Macro. If there are $ N + 1 $ classes in total, the result is equal to the mean of the values

    \[ tp_0 / (tp_0 + fn_0), tp_1 / (tp_1 + fn_1), \ldots, tp_N / (tp_N + fn_N), \]

    where $ tp_i $ and $ fn_i $ are the numbers of true positives and false negatives respectively for the class (label) $ i $.
Template Parameters
ASAn average strategy.
PositiveClassIn the case of binary classification (AS = Binary) positives are assumed to have labels equal to this value.

Definition at line 48 of file recall.hpp.

Member Function Documentation

◆ Evaluate()

static double Evaluate ( MLAlgorithm &  model,
const DataType &  data,
const arma::Row< size_t > &  labels 
)
static

Run classification and calculate recall.

Parameters
modelA classification model.
dataColumn-major data containing test items.
labelsGround truth (correct) labels for the test items.

Member Data Documentation

◆ NeedsMinimization

const bool NeedsMinimization = false
static

Information for hyper-parameter tuning code.

It indicates that we want to maximize the metric.

Definition at line 67 of file recall.hpp.


The documentation for this class was generated from the following file:
  • /home/ryan/src/mlpack.org/_src/mlpack-3.1.0/src/mlpack/core/cv/metrics/recall.hpp