mlpack
3.1.1
src
mlpack
core
cv
metrics
precision.hpp
Go to the documentation of this file.
1
12
#ifndef MLPACK_CORE_CV_METRICS_PRECISION_HPP
13
#define MLPACK_CORE_CV_METRICS_PRECISION_HPP
14
15
#include <
mlpack/core.hpp
>
16
#include <
mlpack/core/cv/metrics/average_strategy.hpp
>
17
18
namespace
mlpack
{
19
namespace
cv {
20
47
template
<AverageStrategy AS,
size_t
PositiveClass = 1>
48
class
Precision
49
{
50
public
:
58
template
<
typename
MLAlgorithm,
typename
DataType>
59
static
double
Evaluate
(MLAlgorithm& model,
60
const
DataType& data,
61
const
arma::Row<size_t>& labels);
62
67
static
const
bool
NeedsMinimization
=
false
;
68
69
private
:
73
template
<
AverageStrategy
_AS,
74
typename
MLAlgorithm,
75
typename
DataType,
76
typename
=
std::enable_if_t<_AS == Binary>
>
77
static
double
Evaluate
(MLAlgorithm& model,
78
const
DataType& data,
79
const
arma::Row<size_t>& labels);
80
84
template
<
AverageStrategy
_AS,
85
typename
MLAlgorithm,
86
typename
DataType,
87
typename
=
std::enable_if_t<_AS == Micro>
,
88
typename
=
void
>
89
static
double
Evaluate
(MLAlgorithm& model,
90
const
DataType& data,
91
const
arma::Row<size_t>& labels);
92
96
template
<
AverageStrategy
_AS,
97
typename
MLAlgorithm,
98
typename
DataType,
99
typename
=
std::enable_if_t<_AS == Macro>
,
100
typename
= void,
101
typename
=
void
>
102
static
double
Evaluate
(MLAlgorithm& model,
103
const
DataType& data,
104
const
arma::Row<size_t>& labels);
105
};
106
107
}
// namespace cv
108
}
// namespace mlpack
109
110
// Include implementation.
111
#include "precision_impl.hpp"
112
113
#endif
mlpack::cv::Precision::NeedsMinimization
static const bool NeedsMinimization
Information for hyper-parameter tuning code.
Definition:
precision.hpp:67
mlpack::cv::AverageStrategy
AverageStrategy
This enum declares possible strategies for averaging that can be used in some metrics like precision,...
Definition:
average_strategy.hpp:25
mlpack
@serialization.hpp
Definition:
add_to_po.hpp:21
mlpack::cv::Precision::Evaluate
static double Evaluate(MLAlgorithm &model, const DataType &data, const arma::Row< size_t > &labels)
Run classification and calculate precision.
std::enable_if_t
typename enable_if< B, T >::type enable_if_t
Definition:
prereqs.hpp:58
mlpack::cv::Precision
Precision is a metric of performance for classification algorithms that for binary classification is ...
Definition:
precision.hpp:48
average_strategy.hpp
core.hpp
Generated by
1.8.17