104template<
class RETURNTYPE,
typename DIMTYPE,
class SUBSET,
class CRITERION,
class EVALUATOR>
107 typedef Search<RETURNTYPE,DIMTYPE,SUBSET,CRITERION>
parent;
115 virtual bool search(
const DIMTYPE target_d, RETURNTYPE &result,
const PSubset sub,
const PCriterion crit, std::ostream& os)
override =0;
128 inline bool Step(
const bool forward, RETURNTYPE &result,
const PSubset sub,
const PCriterion crit, std::ostream& os=std::cout);
145template<
class RETURNTYPE,
typename DIMTYPE,
class SUBSET,
class CRITERION,
class EVALUATOR>
155 bool _mode_change=(sub->get_forward_mode()!=forward);
157 if(_mode_change) sub->set_forward_mode(forward);
159 if(_mode_change) sub->set_forward_mode(!forward);
Abstract class, defines interface for sequential search method implementations, provides common imple...
Definition search_seq.hpp:105
Search< RETURNTYPE, DIMTYPE, SUBSET, CRITERION > parent
base class alias
Definition search_seq.hpp:107
std::shared_ptr< EVALUATOR > PEvaluator
shared pointer to the sequential-step evaluator that implements Step()'s candidate generation and sel...
Definition search_seq.hpp:108
void set_generalization_level(const DIMTYPE g)
optional parameter to enlarge the number of considered candidates (g is the number of features added/...
Definition search_seq.hpp:130
Search_Sequential(const PEvaluator evaluator)
evaluator must be non-null
Definition search_seq.hpp:111
bool Step(const bool forward, RETURNTYPE &result, const PSubset sub, const PCriterion crit, std::ostream &os=std::cout)
Performs one sequential step: adds (forward) or removes (!forward) the best g-tuple of features,...
Definition search_seq.hpp:146
std::shared_ptr< CRITERION > PCriterion
shared pointer to the criterion the search optimizes
Definition search_seq.hpp:109
PEvaluator _evaluator
the sequential-step evaluator injected at construction; drives Step()'s candidate generation and best...
Definition search_seq.hpp:139
virtual bool search(const DIMTYPE target_d, RETURNTYPE &result, const PSubset sub, const PCriterion crit, std::ostream &os) override=0
returns the found subset of target_d features + its criterion value; target_d==0 asks the method to p...
std::shared_ptr< SUBSET > PSubset
shared pointer to a feature subset
Definition search_seq.hpp:110
void enable_initial_subset()
makes search() start from the caller-supplied contents of its sub argument instead of the concrete me...
Definition search_seq.hpp:134
bool initial_subset_enabled() const
true if enable_initial_subset() was called (and not since disabled by disable_initial_subset())
Definition search_seq.hpp:136
DIMTYPE _generalization_level
number of features added/removed together in one Step() call (see set_generalization_level())
Definition search_seq.hpp:140
bool _initial_subset_enabled
by default all concrete search methods ignore the contents of supplied 'PSubset set' and initialize s...
Definition search_seq.hpp:141
void disable_initial_subset()
reverts to the default: incoming sub contents are ignored by search()
Definition search_seq.hpp:135
DIMTYPE get_generalization_level() const
the currently configured generalization level (see set_generalization_level())
Definition search_seq.hpp:131
void report(std::ostream &os, const msgbuf &m) const
delivers one pre-formatted progress message: to the observer if attached, otherwise as syncout text t...
Definition search.hpp:170
bool output_detailed() const
true only at the DETAILED output level
Definition search.hpp:160
Message accumulator for Search::report() - collects one progress message exactly as an std::ostringst...
Definition search.hpp:87
FST4 specific error passing class.
The Feature Selection Toolbox 4 library: every library component – data access, criteria and classifi...
Definition data_accessor.hpp:80
void notify(const std::string msg)
Prints msg followed by a newline via syncout::print(); a no-op unless the preprocessor macro DEBUG is...
Definition global.hpp:112
SearchDirection
Direction a sequential search proceeds in.
Definition search_seq.hpp:91
Defines interface for search method implementations.