Feature Selection Toolbox FST4
UTIA · Czech Academy of Sciences
Loading...
Searching...
No Matches
FST::Branch_And_Bound_Predictor_Averaging< RETURNTYPE, DIMTYPE > Class Template Reference

Averaging Prediction Mechanism in Fast Branch and Bound & Branch and Bound with Partial Prediction. More...

#include <branch_and_bound_predictor_averaging.hpp>

Inheritance diagram for FST::Branch_And_Bound_Predictor_Averaging< RETURNTYPE, DIMTYPE >:
FST::Branch_And_Bound_Predictor< RETURNTYPE, DIMTYPE >

Public Member Functions

virtual void initialize (const DIMTYPE features) override
 (re)initializes the per-feature sum/count accumulators to zero for features features; call before use for each new search
virtual bool learn (const DIMTYPE feature, const RETURNTYPE value) override
 adds one observed value (non-negative, asserted) to feature 's running sum and increments its sample count; always returns true
virtual bool predict (const DIMTYPE feature, RETURNTYPE &value) const override
 sets value to the gamma-scaled running average learned for feature and returns true, but only once at least _delta samples have been learned for it; returns false otherwise
unsigned long get_count (const DIMTYPE feature) const
 the number of learn() calls recorded so far for feature - a diagnostic accessor, telling how well founded the feature's prediction is (predict() succeeds once this reaches the delta set by set_delta())
void set_gamma (const RETURNTYPE gamma=1.0)
 sets the scaling factor applied to the averaged value in predict() (asserted >=0.0); default 1.0 = plain average
void set_delta (const unsigned int delta=1)
 sets the minimum sample count a feature must reach before predict() returns a value (asserted >=1); default 1 = predict as soon as one sample is learned
virtual std::ostream & print (std::ostream &os) const override
 writes gamma/delta plus, for every feature with at least one learned sample, its current predicted value and sample count, and the total sample count across all features

Protected Attributes

std::vector< RETURNTYPE > _value
 sums up 'learned' values
std::vector< unsigned long > _count
 records the number of summed up values
RETURNTYPE _gamma
 scaling factor applied to the averaged prediction; see set_gamma()
unsigned int _delta
 minimum sample count before predict() returns a value; see set_delta()

Detailed Description

template<class RETURNTYPE, typename DIMTYPE>
class FST::Branch_And_Bound_Predictor_Averaging< RETURNTYPE, DIMTYPE >

Averaging Prediction Mechanism in Fast Branch and Bound & Branch and Bound with Partial Prediction.

Caller convention (see Search_Branch_And_Bound_Fast/_Partial_Prediction): the "value" learned for a feature is the nonnegative criterion-value drop caused by removing that feature from a node's parent (parent value - child value), and the "value" predicted for a feature is used the same way to estimate an unevaluated child's value as parent value - predicted drop. This class itself is agnostic to that interpretation; it just accumulates and averages whatever per-feature values it is given.

Member Function Documentation

◆ initialize()

template<class RETURNTYPE, typename DIMTYPE>
void FST::Branch_And_Bound_Predictor_Averaging< RETURNTYPE, DIMTYPE >::initialize ( const DIMTYPE features)
overridevirtual

(re)initializes the per-feature sum/count accumulators to zero for features features; call before use for each new search

Implements FST::Branch_And_Bound_Predictor< RETURNTYPE, DIMTYPE >.

◆ learn()

template<class RETURNTYPE, typename DIMTYPE>
bool FST::Branch_And_Bound_Predictor_Averaging< RETURNTYPE, DIMTYPE >::learn ( const DIMTYPE feature,
const RETURNTYPE value )
overridevirtual

adds one observed value (non-negative, asserted) to feature 's running sum and increments its sample count; always returns true

Implements FST::Branch_And_Bound_Predictor< RETURNTYPE, DIMTYPE >.

◆ predict()

template<class RETURNTYPE, typename DIMTYPE>
bool FST::Branch_And_Bound_Predictor_Averaging< RETURNTYPE, DIMTYPE >::predict ( const DIMTYPE feature,
RETURNTYPE & value ) const
overridevirtual

sets value to the gamma-scaled running average learned for feature and returns true, but only once at least _delta samples have been learned for it; returns false otherwise

Implements FST::Branch_And_Bound_Predictor< RETURNTYPE, DIMTYPE >.

◆ print()

template<class RETURNTYPE, typename DIMTYPE>
std::ostream & FST::Branch_And_Bound_Predictor_Averaging< RETURNTYPE, DIMTYPE >::print ( std::ostream & os) const
overridevirtual

writes gamma/delta plus, for every feature with at least one learned sample, its current predicted value and sample count, and the total sample count across all features

Reimplemented from FST::Branch_And_Bound_Predictor< RETURNTYPE, DIMTYPE >.


The documentation for this class was generated from the following file:
Copyright © 2000–present ÚTIA, Institute of Information Theory and Automation of the Czech Academy of Sciences · Contacts · This site sets no cookies and uses no analytics.