Abstract class, defines interface for implementations of one selection step in sequential search type of methods. More...
#include <seq_step.hpp>
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. | |
Abstract class, defines interface for implementations of one selection step in sequential search type of methods.
|
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.
| result | receives the criterion value of the chosen candidate; meaningful only if true is returned |
| sub | in: 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 |
| crit | the criterion the candidates are evaluated by; must be non-null and already initialize()d |
| _generalization_level | number of features added or removed at once (>=1, and at most the number of features) |
| os | stream the step's progress messages are written to |
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 >.
|
inlinevirtual |
writes a human-readable identification of the step and its configuration; base default writes nothing
Reimplemented 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 >.