libeblearn
|
#include <ebl_answer.h>
Public Member Functions | |
regression_answer (uint nfeatures, float64 threshold=0.0, const char *name="regression_answer") | |
virtual void | fprop (Tstate &in, Tstate &out) |
Does nothing but copying in to out. | |
virtual void | fprop (labeled_datasource< T, Tds1, Tds2 > &ds, Tstate &out) |
virtual bool | correct (Tstate &answer, Tstate &label) |
virtual void | update_log (classifier_meter &log, intg age, idx< T > &energy, idx< T > &answer, idx< T > &label, idx< T > &target, idx< T > &rawout) |
Update the 'log' according to this type of answer module. | |
virtual std::string | describe () |
Returns a string describing this module and its parameters. | |
Protected Attributes | |
float64 | threshold |
The threshold used for correctness. |
This module gathers information from a labeled_datasource 'ds' and outputs a state of type 'Tstate'. The output state is simply the label itself. Thus this module can be used for regression as it does not transform the labels into classification targets. The useful part of this module is the fprop answering, which estimates if a prediction is correct (1) or not (0), when the L1 distance of the prediction to the groundtruth is below a certain threshold, specified in the constructor.
ebl::regression_answer< T, Tds1, Tds2, Tstate >::regression_answer | ( | uint | nfeatures, |
float64 | threshold = 0.0 , |
||
const char * | name = "regression_answer< T, Tds1, Tds2, Tstate >" |
||
) |
threshold | When the L1 distance to the groundtruth is less than this threshold, the answer is considered correct. |
bool ebl::regression_answer< T, Tds1, Tds2, Tstate >::correct | ( | Tstate & | answer, |
Tstate & | label | ||
) | [virtual] |
Returns true if the L1 distance between 'answer' and 'label' is less than internal threshold.
Reimplemented from ebl::answer_module< T, Tds1, Tds2, Tstate >.
void ebl::regression_answer< T, Tds1, Tds2, Tstate >::fprop | ( | labeled_datasource< T, Tds1, Tds2 > & | ds, |
Tstate & | out | ||
) | [virtual] |
This method simply takes the current label in 'ds' and copies it to the output without transformation.
Reimplemented from ebl::answer_module< T, Tds1, Tds2, Tstate >.