Repeatedly samples random subsets to eventually yield the one with highest criterion value. More...
#include <search_monte_carlo.hpp>
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 |
Repeatedly samples random subsets to eventually yield the one with highest criterion value.
demo24.cpp, and demo34.cpp.