Ultra 0.9.4
Loading...
Searching...
No Matches
ultra::src::count_error_functor< P > Class Template Reference

#include <evaluator.h>

Public Member Functions

 count_error_functor (const P &)
double operator() (const example &) const

Detailed Description

template<Individual P>
class ultra::src::count_error_functor< P >

Classification error functor based on exact matches.

Template Parameters
Pindividual type

The functor owns an oracle initialised from the program and computes a scalar error value for each training example.

This functor returns 0 for a correct prediction and 1 otherwise. When used with sum_error_evaluator, fitness corresponds to the negative number of classification errors.

See also
count_error_evaluator

Constructor & Destructor Documentation

◆ count_error_functor()

template<Individual P>
count_error_functor::count_error_functor ( const P & prg)
explicit

Sets up the environment for error measurement.

Parameters
[in]prgthe program to be measured

Member Function Documentation

◆ operator()()

template<Individual P>
double count_error_functor::operator() ( const example & example) const
nodiscard
Parameters
[in]examplecurrent training case
Returns
a measurement of the error of the model/program on the current training case. The value returned is in the [0;1] range

The documentation for this class was generated from the following files: