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

Abstract class, defines interface for implementations of one selection step in sequential search type of methods. More...

#include <seq_step.hpp>

Inheritance diagram for FST::Sequential_Step< RETURNTYPE, DIMTYPE, SUBSET, CRITERION >:
FST::Sequential_Step_Hybrid< RETURNTYPE, DIMTYPE, SUBSET, CRITERION, CRITERION > FST::Sequential_Step_Sampled< RETURNTYPE, DIMTYPE, SUBSET, CRITERION, WEIGHTER_SAMPLED > FST::Sequential_Step_Ensemble< RETURNTYPE, DIMTYPE, SUBSET, CRITERION > FST::Sequential_Step_Hybrid< RETURNTYPE, DIMTYPE, SUBSET, CRITERION, FILTERCRITERION > FST::Sequential_Step_Sampled< RETURNTYPE, DIMTYPE, SUBSET, CRITERION, WEIGHTER > FST::Sequential_Step_Straight< RETURNTYPE, DIMTYPE, SUBSET, CRITERION > FST::Sequential_Step_Straight_Threaded< RETURNTYPE, DIMTYPE, SUBSET, CRITERION >

Public Types

typedef std::shared_ptr< CRITERION > PCriterion
 shared pointer to the criterion this step evaluates candidates against
typedef std::shared_ptr< SUBSET > PSubset
 shared pointer to a feature subset
typedef std::shared_ptr< Result_Tracker< RETURNTYPE, SUBSET > > PResultTracker
 shared pointer to the result tracker enabled via enable_result_tracking()

Public Member Functions

virtual bool evaluate_candidates (RETURNTYPE &result, const PSubset sub, const PCriterion crit, const DIMTYPE _generalization_level, std::ostream &os)=0
 Performs one selection step: evaluates the candidate subsets reachable from sub and leaves the best of them in sub.
virtual std::ostream & print (std::ostream &os) const
 writes a human-readable identification of the step and its configuration; base default writes nothing
void enable_result_tracking (PResultTracker tracker)
 assigns a result tracker to this step, i.e., enables logging of all evaluated candidate subsets for future reuse (re-evaluation, etc.)
void disable_result_tracking ()
 detaches any result tracker (result_tracker_active() then returns false)
bool result_tracker_active () const
 true if a result tracker was assigned via enable_result_tracking() and not since disabled
void set_output_detail (OutputDetail detail)
 sets the amount of information that is logged to output stream throughout the course of search
OutputDetail get_output_detail () const
 the currently configured output detail level
bool output_normal () const
 true unless output detail is SILENT
bool output_detailed () const
 true only at the DETAILED output level

Protected Attributes

PResultTracker _tracker
 the assigned result tracker, or null (see enable_result_tracking()/result_tracker_active())
OutputDetail _detail
 the output detail level set via set_output_detail(); read by output_normal()/output_detailed()

Friends

std::ostream & operator<< (std::ostream &os, const Sequential_Step< RETURNTYPE, DIMTYPE, SUBSET, CRITERION > &ss)
 Streams a selection step's print() to os.

Detailed Description

template<class RETURNTYPE, typename DIMTYPE, class SUBSET, class CRITERION>
class FST::Sequential_Step< RETURNTYPE, DIMTYPE, SUBSET, CRITERION >

Abstract class, defines interface for implementations of one selection step in sequential search type of methods.

Note
To prevent misunderstanding: _generalization_level here does not relate to classification performance on unknown data, but to "generalization" of sequential steps in the course of search, i.e., the number of features added/removed while generating candidate subsets (higher generalization=more candidates)

Member Function Documentation

◆ evaluate_candidates()

template<class RETURNTYPE, typename DIMTYPE, class SUBSET, class CRITERION>
virtual bool FST::Sequential_Step< RETURNTYPE, DIMTYPE, SUBSET, CRITERION >::evaluate_candidates ( RETURNTYPE & result,
const PSubset sub,
const PCriterion crit,
const DIMTYPE _generalization_level,
std::ostream & os )
pure virtual

Performs one selection step: evaluates the candidate subsets reachable from sub and leaves the best of them in sub.

This is the extension point of the whole sequential search family - a different candidate-selection strategy (prefiltering, ensemble voting, budgeted sampling, ...) is introduced by implementing this one method.

The candidates are the subsets offered by sub->getFirstCandidateSubset() and sub->getNextCandidateSubset(): those differing from sub in _generalization_level features, added in forward mode and removed in backward mode. An implementation may evaluate all of them or any subset of them, but must leave the chosen candidate in sub and its criterion value in result.

Parameters
resultreceives the criterion value of the chosen candidate; meaningful only if true is returned
subin: the subset the candidates are generated from; out: the chosen candidate. sub doubles as the traversal state, so its contents are modified even when the call returns false
critthe criterion the candidates are evaluated by; must be non-null and already initialize()d
_generalization_levelnumber of features added or removed at once (>=1, and at most the number of features)
osstream the step's progress messages are written to
Returns
false if no candidate subset could be generated at all (nothing left to add or remove), or if a criterion evaluation failed; the caller must then treat the step as not performed

Implemented in FST::Sequential_Step_Ensemble< RETURNTYPE, DIMTYPE, SUBSET, CRITERION >, FST::Sequential_Step_Hybrid< RETURNTYPE, DIMTYPE, SUBSET, CRITERION, FILTERCRITERION >, FST::Sequential_Step_Hybrid< RETURNTYPE, DIMTYPE, SUBSET, CRITERION, CRITERION >, FST::Sequential_Step_Sampled< RETURNTYPE, DIMTYPE, SUBSET, CRITERION, WEIGHTER >, FST::Sequential_Step_Sampled< RETURNTYPE, DIMTYPE, SUBSET, CRITERION, WEIGHTER_SAMPLED >, and FST::Sequential_Step_Straight< RETURNTYPE, DIMTYPE, SUBSET, CRITERION >.

◆ print()


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.