12 #ifndef MLPACK_CORE_CV_METRICS_F1_HPP 13 #define MLPACK_CORE_CV_METRICS_F1_HPP 15 #include <type_traits> 44 template<AverageStrategy AS,
size_t PositiveClass = 1>
55 template<
typename MLAlgorithm,
typename DataType>
56 static double Evaluate(MLAlgorithm& model,
58 const arma::Row<size_t>& labels);
73 typename = std::enable_if_t<_AS == Binary>>
74 static double Evaluate(MLAlgorithm& model,
76 const arma::Row<size_t>& labels);
84 typename = std::enable_if_t<_AS == Micro>,
86 static double Evaluate(MLAlgorithm& model,
88 const arma::Row<size_t>& labels);
96 typename = std::enable_if_t<_AS == Macro>,
99 static double Evaluate(MLAlgorithm& model,
100 const DataType& data,
101 const arma::Row<size_t>& labels);
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
static const bool NeedsMinimization
Information for hyper-parameter tuning code.
Definition: f1.hpp:64
static double Evaluate(MLAlgorithm &model, const DataType &data, const arma::Row< size_t > &labels)
Run classification and calculate F1.
Definition: f1_impl.hpp:22
Include all of the base components required to write mlpack methods, and the main mlpack Doxygen docu...
F1 is a metric of performance for classification algorithms that for binary classification is equal t...
Definition: f1.hpp:45
AverageStrategy
This enum declares possible strategies for averaging that can be used in some metrics like precision...
Definition: average_strategy.hpp:25