Ultra 0.9.4
Loading...
Searching...
No Matches
metrics.h File Reference
#include "kernel/gp/src/predictor.h"
#include <cmath>
#include <limits>
#include <ranges>

Go to the source code of this file.

Namespaces

namespace  ultra

Functions

template<ClassificationPredictor P>
double ultra::src::metrics::accuracy (const P &p, const dataframe &d)
template<RegressionPredictor P>
double ultra::src::metrics::mae (const P &p, const dataframe &d)

Detailed Description

Remarks
This file is part of ULTRA.
License

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/

Function Documentation

◆ accuracy()

template<ClassificationPredictor P>
double ultra::src::metrics::accuracy ( const P & p,
const dataframe & d )
nodiscard

Accuracy for classification problems.

Parameters
[in]poracle-like object
[in]dclassification dataset
Returns
fraction of correctly classified examples

Accuracy refers to the number of training examples that are correctly valued/classified as a proportion of the total number of examples in the training set.

According to this design, the best accuracy is 1.0 (100%), meaning that all the training examples have been correctly recognized.

Note
Accuracy and fitness aren't the same thing. Accuracy can be used to measure fitness but often it hasn't enough "granularity"; also it isn't appropriated for classification tasks with imbalanced learning data (where at least one class is under/over represented relative to others).

◆ mae()

template<RegressionPredictor P>
double ultra::src::metrics::mae ( const P & p,
const dataframe & d )
nodiscard

Mean absolute error for regression problems.

Missing predictions are ignored. If no valid prediction is produced, the function returns infinity().

Parameters
[in]poracle-like object
[in]dregression dataset
Returns
mean absolute error over valid predictions