Feature Selection ToolboxFST3 Library / Documentation

FST::Sequential_Step_Straight_Threaded< RETURNTYPE, DIMTYPE, SUBSET, CRITERION, max_threads > Class Template Reference

Implements threaded version of sequential selection step in sequential search type of methods. More...

#include <seq_step_straight_threaded.hpp>

Inheritance diagram for FST::Sequential_Step_Straight_Threaded< RETURNTYPE, DIMTYPE, SUBSET, CRITERION, max_threads >:
Collaboration diagram for FST::Sequential_Step_Straight_Threaded< RETURNTYPE, DIMTYPE, SUBSET, CRITERION, max_threads >:

List of all members.

Public Types

typedef Sequential_Step
< RETURNTYPE, DIMTYPE, SUBSET,
CRITERION > 
parent
typedef boost::shared_ptr
< CRITERION > 
PCriterion
typedef boost::shared_ptr< SUBSET > PSubset

Public Member Functions

bool evaluate_candidates (RETURNTYPE &result, const PSubset sub, const PCriterion crit, const DIMTYPE _generalization_level=1, std::ostream &os=std::cout)
 chooses among subsets offered by sub->get*CandidateSubset()
virtual std::ostream & print (std::ostream &os) const

Protected Attributes

Candidate_Evaluator_Threaded
< RETURNTYPE, DIMTYPE, SUBSET,
CRITERION, max_threads > 
_evaluator

Detailed Description

template<class RETURNTYPE, typename DIMTYPE, class SUBSET, class CRITERION, unsigned int max_threads = 2>
class FST::Sequential_Step_Straight_Threaded< RETURNTYPE, DIMTYPE, SUBSET, CRITERION, max_threads >

Implements threaded version of sequential selection step in sequential search type of methods.

Concurrently evaluates each subset candidate using clones of the supplied criterion and returns the one subset that yielded highest criterion value

Warning:
Note that Threaded_Criterion_Evaluator keeps the pointer to criterion object as supplied to evaluate_candidates. At the time of first launch of the worker threads the pointed crit is cloned to get as many clones as there will be threads. It is important to realize that the clones are kept and reused as long as the 'crit' parameter to evaluate_candidates remains the same. Note that the state of the clones is not! synchronized with the possibly changing state of the pointed template criterion. This has implications especially when used with Criterion_Wrapper, which depends on current data split. If the current split changes, the change does not propagate to clones and the results are thus obtained for the wrong part of data. Therefore, to ensure the correct results are achieved, better re-allocate the Sequential_Step_Straight_Threaded object so that it's criterion clones are re-generated whenever the current context of the primary criterion changes - typically after every data split change.
Examples:

demo11t.cpp, demo12t.cpp, demo25t.cpp, demo33t.cpp, and demo52t.cpp.


The documentation for this class was generated from the following file:

Generated on Thu Mar 31 11:39:05 2011 for FST3Library by  doxygen 1.6.1