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

Defines Interface for Implementations of Prediction Mechanism in Fast Branch and Bound & Branch and Bound with Partial Prediction. More...

#include <branch_and_bound_predictor.hpp>

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

Public Member Functions

virtual void initialize (const DIMTYPE features)=0
 (Re)initializes the predictor's per-feature state for features features; must be called before learn()/predict(), and again for every new search.
virtual bool learn (const DIMTYPE feature, const RETURNTYPE value)=0
 Records an observed criterion value for feature, updating that feature's state only (see the class's per-feature isolation contract above).
virtual bool predict (const DIMTYPE feature, RETURNTYPE &value) const =0
 Predicts feature's criterion value from its previously learn()ed observations, without evaluating the criterion.
virtual std::ostream & print (std::ostream &os) const
 writes a human-readable identification of the predictor's learned state; base default writes nothing

Friends

std::ostream & operator<< (std::ostream &os, const Branch_And_Bound_Predictor< RETURNTYPE, DIMTYPE > &babp)
 Streams a predictor's print() (implementation-defined diagnostic state) to os.

Detailed Description

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

Defines Interface for Implementations of Prediction Mechanism in Fast Branch and Bound & Branch and Bound with Partial Prediction.

Warning
CONTRACT relied on by the threaded FBB/BBPP bodies: predictor state must be isolated per feature - predict(f) may read only state learned for feature f, and learn(f) may modify only feature f's state. FBB/BBPP decide predict-vs-compute for a whole tree level upfront on the master thread and replay the learns in candidate order after the batched evaluations; that upfront pass gives the same decisions as deciding one candidate at a time exactly because no feature's decision can observe another feature's same-level learn. A predictor that let features share state would make the two passes differ, and threaded runs would stop reproducing sequential ones - do not implement one against this interface.

Member Function Documentation

◆ initialize()

template<class RETURNTYPE, typename DIMTYPE>
virtual void FST::Branch_And_Bound_Predictor< RETURNTYPE, DIMTYPE >::initialize ( const DIMTYPE features)
pure virtual

(Re)initializes the predictor's per-feature state for features features; must be called before learn()/predict(), and again for every new search.

Parameters
featuresnumber of features the predictor will track (features 0..features-1); must be at least 1
Precondition
features>=1 - a predictor tracking nothing has no use, and implementations assert against it

Implemented in FST::Branch_And_Bound_Predictor_Averaging< RETURNTYPE, DIMTYPE >.

◆ learn()

template<class RETURNTYPE, typename DIMTYPE>
virtual bool FST::Branch_And_Bound_Predictor< RETURNTYPE, DIMTYPE >::learn ( const DIMTYPE feature,
const RETURNTYPE value )
pure virtual

Records an observed criterion value for feature, updating that feature's state only (see the class's per-feature isolation contract above).

Parameters
featurethe feature this observation belongs to
valuethe observed criterion value
Returns
false if the observation could not be recorded; implementations that never reject an observation return true unconditionally

Implemented in FST::Branch_And_Bound_Predictor_Averaging< RETURNTYPE, DIMTYPE >.

◆ predict()

template<class RETURNTYPE, typename DIMTYPE>
virtual bool FST::Branch_And_Bound_Predictor< RETURNTYPE, DIMTYPE >::predict ( const DIMTYPE feature,
RETURNTYPE & value ) const
pure virtual

Predicts feature's criterion value from its previously learn()ed observations, without evaluating the criterion.

Parameters
featurethe feature to predict a value for
valueset to the predicted value on success; left unspecified on failure
Returns
false if not enough observations are available yet for feature – predict-vs-compute callers (FBB/BBPP) then fall back to actually evaluating the criterion for it

Implemented in FST::Branch_And_Bound_Predictor_Averaging< RETURNTYPE, DIMTYPE >.

◆ print()

template<class RETURNTYPE, typename DIMTYPE>
virtual std::ostream & FST::Branch_And_Bound_Predictor< RETURNTYPE, DIMTYPE >::print ( std::ostream & os) const
inlinevirtual

writes a human-readable identification of the predictor's learned state; base default writes nothing

Reimplemented in FST::Branch_And_Bound_Predictor_Averaging< 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.