libeblearn
ebl::regression_answer< T, Tds1, Tds2, Tstate > Class Template Reference

#include <ebl_answer.h>

Inheritance diagram for ebl::regression_answer< T, Tds1, Tds2, Tstate >:
ebl::answer_module< T, Tds1, Tds2, Tstate > ebl::module_1_1< T, Tstate > ebl::module

List of all members.

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.

Detailed Description

template<typename T, typename Tds1 = T, typename Tds2 = T, class Tstate = bbstate_idx<T>>
class ebl::regression_answer< T, Tds1, Tds2, Tstate >

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.


Constructor & Destructor Documentation

template<typename T , typename Tds1 , typename Tds2 , class Tstate >
ebl::regression_answer< T, Tds1, Tds2, Tstate >::regression_answer ( uint  nfeatures,
float64  threshold = 0.0,
const char *  name = "regression_answer< T, Tds1, Tds2, Tstate >" 
)
Parameters:
thresholdWhen the L1 distance to the groundtruth is less than this threshold, the answer is considered correct.

Member Function Documentation

template<typename T , typename Tds1 , typename Tds2 , class Tstate >
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 >.

template<typename T , typename Tds1 , typename Tds2 , class 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 >.


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