- Copyright
- Copyright (C) 2026 EOS di Manlio Morini.
- 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/
template<ClassificationPredictor P>
| double ultra::src::metrics::accuracy |
( |
const P & | p, |
|
|
const dataframe & | d ) |
|
nodiscard |
Accuracy for classification problems.
- Parameters
-
| [in] | p | oracle-like object |
| [in] | d | classification 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).