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

Implements standard sequential selection step in sequential search type of methods. More...

#include <seq_step_straight.hpp>

Inheritance diagram for FST::Sequential_Step_Straight< RETURNTYPE, DIMTYPE, SUBSET, CRITERION >:
FST::Sequential_Step< RETURNTYPE, DIMTYPE, SUBSET, CRITERION > FST::Sequential_Step_Straight_Threaded< RETURNTYPE, DIMTYPE, SUBSET, CRITERION >

Public Types

typedef Sequential_Step< RETURNTYPE, DIMTYPE, SUBSET, CRITERION > parent
 base class alias
typedef std::shared_ptr< CRITERION > PCriterion
 shared pointer to the criterion the search optimizes
typedef std::shared_ptr< SUBSET > PSubset
 shared pointer to a feature subset
typedef Candidate_Evaluator< RETURNTYPE, DIMTYPE, SUBSET, CRITERION > EVALUATORENGINE
 the injected evaluation-strategy interface (sequential in-line or thread-pooled)
typedef std::shared_ptr< EVALUATORENGINE > PEvaluatorEngine
Public Types inherited from FST::Sequential_Step< RETURNTYPE, DIMTYPE, SUBSET, CRITERION >
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

 Sequential_Step_Straight (PEvaluatorEngine engine=PEvaluatorEngine())
 engine defaults to sequential in-line evaluation (Candidate_Evaluator_Sequential) if not supplied; pass a Candidate_Evaluator_Threaded to have the candidates evaluated in a thread pool
bool evaluate_candidates (RETURNTYPE &result, const PSubset sub, const PCriterion crit, const DIMTYPE _generalization_level=1, std::ostream &os=std::cout) override
 evaluates every subset offered by sub->get*CandidateSubset() and leaves the highest-valued one in sub (see Sequential_Step::evaluate_candidates() for the full contract)
virtual std::ostream & print (std::ostream &os) const override
 writes "Sequential_Step_Straight(threads=N)" if the injected engine is threaded, else "Sequential_Step_Straight()"
Public Member Functions inherited from FST::Sequential_Step< RETURNTYPE, DIMTYPE, SUBSET, CRITERION >
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

PEvaluatorEngine _engine
 injected evaluation strategy (sequential-inline or thread-pooled); defaulted in the constructor if not supplied
Protected Attributes inherited from FST::Sequential_Step< RETURNTYPE, DIMTYPE, SUBSET, CRITERION >
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()

Detailed Description

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

Implements standard sequential selection step in sequential search type of methods.

Note
Evaluates each subset candidate using the supplied criterion and returns the one subset that yielded highest criterion value; ties go to the candidate generated first. This single class serves both the sequential and the threaded execution model: the evaluation strategy (a Candidate_Evaluator implementation) is injected through the constructor and defaults to sequential in-line evaluation. Construct with a Candidate_Evaluator_Threaded to evaluate the candidates in a thread pool - the chosen candidate is the same either way.
Warning
With a threaded engine the criterion is cloned per worker on first use and the clones are not kept in step with the original afterwards, so the step object must be re-created whenever the criterion's context changes (typically after every data split change) - see the class documentation of Candidate_Evaluator_Threaded.
Examples
demo10.cpp, demo52t.cpp, and demo55.cpp.

Member Typedef Documentation

◆ PEvaluatorEngine

template<class RETURNTYPE, typename DIMTYPE, class SUBSET, class CRITERION>
typedef std::shared_ptr<EVALUATORENGINE> FST::Sequential_Step_Straight< RETURNTYPE, DIMTYPE, SUBSET, CRITERION >::PEvaluatorEngine

shared pointer to an EVALUATORENGINE

Member Function Documentation

◆ evaluate_candidates()

template<class RETURNTYPE, typename DIMTYPE, class SUBSET, class CRITERION>
bool FST::Sequential_Step_Straight< RETURNTYPE, DIMTYPE, SUBSET, CRITERION >::evaluate_candidates ( RETURNTYPE & result,
const PSubset sub,
const PCriterion crit,
const DIMTYPE _generalization_level = 1,
std::ostream & os = std::cout )
inlineoverridevirtual

evaluates every subset offered by sub->get*CandidateSubset() and leaves the highest-valued one in sub (see Sequential_Step::evaluate_candidates() for the full contract)

Implements FST::Sequential_Step< RETURNTYPE, DIMTYPE, SUBSET, CRITERION >.

◆ print()

template<class RETURNTYPE, typename DIMTYPE, class SUBSET, class CRITERION>
virtual std::ostream & FST::Sequential_Step_Straight< RETURNTYPE, DIMTYPE, SUBSET, CRITERION >::print ( std::ostream & os) const
inlineoverridevirtual

writes "Sequential_Step_Straight(threads=N)" if the injected engine is threaded, else "Sequential_Step_Straight()"

Reimplemented from FST::Sequential_Step< RETURNTYPE, DIMTYPE, SUBSET, CRITERION >.


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.