|
mlpack 3.4.2
|
Precision is a metric of performance for classification algorithms that for binary classification is equal to 


#include <precision.hpp>
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 precision. More... | |
Static Public Attributes | |
| static const bool | NeedsMinimization = false |
| Information for hyper-parameter tuning code. More... | |
Precision is a metric of performance for classification algorithms that for binary classification is equal to 


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

![\[
(tp_0 + tp_1 + \ldots + tp_N) / (tp_0 + tp_1 + \ldots + tp_N + fp_0 + fp_1 +
\ldots + fp_N),
\]](form_5.png)




![\[
tp_0 / (tp_0 + fp_0), tp_1 / (tp_1 + fp_1), \ldots, tp_N / (tp_N + fp_N),
\]](form_9.png)



| AS | An average strategy. |
| PositiveClass | In the case of binary classification (AS = Binary) positives are assumed to have labels equal to this value. |
Definition at line 48 of file precision.hpp.
|
static |
Run classification and calculate precision.
| model | A classification model. |
| data | Column-major data containing test items. |
| labels | Ground truth (correct) labels for the test items. |
|
static |
Information for hyper-parameter tuning code.
It indicates that we want to maximize the metric.
Definition at line 67 of file precision.hpp.
1.9.5