Feature Selection ToolboxFST3 Library / DocumentationShare

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

Repeatedly samples random subsets to eventually yield the one with highest criterion value. More...

#include <search_monte_carlo.hpp>

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

List of all members.

Public Types

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

Public Member Functions

 Search_Monte_Carlo (const unsigned long trials_limit=1000, const unsigned long time_limit=0, const unsigned int time_limit_check_freq=1)
virtual bool search (const DIMTYPE target_d, RETURNTYPE &result, const PSubset sub, const PCriterion crit, std::ostream &os=std::cout)
 returns found subset of target_d features (optimizes cardinality if target_d==0) + criterion value
void set_stopping_condition (const unsigned long trials_limit=1000, const unsigned long time_limit=0, const unsigned int time_limit_check_freq=100)
 set maximum number of random trials or maximum time in seconds or both
void set_cardinality_randomization (const DIMTYPE d_from, const DIMTYPE d_to)
 generate subset size first from [d_from,d_to], then randomly choose exactly that number of features
void set_cardinality_randomization (const float d_prob)
 for each feature roll the dice and select it with probability d_prob
void reset_cardinality_randomization ()
 equivalent to set_cardinality_randomization(1,no_of_all_features)
virtual std::ostream & print (std::ostream &os) const

Protected Attributes

unsigned long _time_limit
 max time allowed to be spent in seconds
unsigned long _trials_limit
 max no of candidates evaluated
unsigned int _time_limit_check_freq
 number of trials before next time check
DIMTYPE _d_from
DIMTYPE _d_to
 generate random subsets of size within these limits
float _d_prob
 active d_prob must be from (0,1]; generates random subset of random size where the mean size over a series of calls is d_prob*no_of_all_features

Detailed Description

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

Repeatedly samples random subsets to eventually yield the one with highest criterion value.

Note:
Requires user-set terminating condition, either in form of the number of random trials accomplished or in form of maximum time spent or both.
offers two ways of random subset generation: a) set_cardinality_randomization(const DIMTYPE d_from, const DIMTYPE d_to) invokes the first option, i.e., when generating a random subset, the subset size is first chosen randomly from [d_from,d_to], then features are randomly selected until the required number is reached b) set_cardinality_randomization(const float d_prob) invokes the second option, where each feature is randomly included/excluded with probability d_prob. The expected subset size is thus d_prob*no_of_all_features, but can be actually anything from [0,no_of_all_features].
Examples:

demo24.cpp, and demo34.cpp.


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

Generated on Thu Mar 31 11:38:56 2011 for FST3Library by  doxygen 1.6.1