Brush C++ API
A flexible interpretable machine learning framework
Loading...
Searching...
No Matches
Brush::Parameters Struct Reference

#include <params.h>

Collaboration diagram for Brush::Parameters:

Public Member Functions

 Parameters ()
 
 ~Parameters ()
 
void set_verbosity (int new_verbosity)
 
int get_verbosity ()
 
void set_random_state (int new_random_state)
 
int get_random_state ()
 
void set_pop_size (int new_pop_size)
 
int get_pop_size ()
 
void set_max_gens (int new_max_gens)
 
int get_max_gens ()
 
void set_bandit (string new_bandit)
 
string get_bandit ()
 
void set_max_stall (int new_max_stall)
 
int get_max_stall ()
 
void set_max_time (int new_max_time)
 
int get_max_time ()
 
void set_scorer (string new_scorer)
 
string get_scorer ()
 
void set_load_population (string new_load_population)
 
string get_load_population ()
 
void set_save_population (string new_save_population)
 
string get_save_population ()
 
string get_logfile ()
 
void set_logfile (string s)
 
void set_current_gen (unsigned int gen)
 
unsigned int get_current_gen ()
 
void set_num_islands (int new_num_islands)
 
int get_num_islands ()
 
void set_max_depth (unsigned new_max_depth)
 
unsigned get_max_depth () const
 
void set_n_jobs (int new_n_jobs)
 
int get_n_jobs ()
 
void set_max_size (unsigned new_max_size)
 
unsigned get_max_size () const
 
void set_objectives (vector< string > new_objectives)
 
vector< stringget_objectives () const
 
void set_sel (string new_sel)
 
string get_sel ()
 
void set_surv (string new_surv)
 
string get_surv ()
 
void set_cx_prob (float new_cx_prob)
 
float get_cx_prob ()
 
void set_mig_prob (float new_mig_prob)
 
float get_mig_prob ()
 
void set_use_arch (bool new_use_arch)
 
bool get_use_arch ()
 
void set_val_from_arch (bool new_val_from_arch)
 
bool get_val_from_arch ()
 
void set_classification (bool c)
 
bool get_classification ()
 
void set_shuffle_split (bool shuff)
 
bool get_shuffle_split ()
 
void set_constants_simplification (bool cs)
 
bool get_constants_simplification ()
 
void set_inexact_simplification (bool is)
 
bool get_inexact_simplification ()
 
void set_weights_init (bool init)
 
bool get_weights_init ()
 
void set_n_classes (const ArrayXf &y)
 
void set_class_weights (const ArrayXf &y)
 
void set_sample_weights (const ArrayXf &y)
 
unsigned int get_n_classes ()
 
vector< float > get_class_weights ()
 
vector< float > get_sample_weights ()
 
void set_validation_size (float s)
 
float get_validation_size ()
 
void set_feature_names (vector< string > vn)
 
vector< stringget_feature_names ()
 
void set_feature_types (vector< string > ft)
 
vector< stringget_feature_types ()
 
void set_batch_size (float c)
 
float get_batch_size ()
 
void set_mutation_probs (std::map< std::string, float > new_mutation_probs)
 
std::map< std::string, float > get_mutation_probs ()
 
void set_functions (std::unordered_map< std::string, float > new_functions)
 
std::unordered_map< std::string, float > get_functions ()
 

Public Attributes

int random_state = 0
 
int verbosity = 0
 
string mode ="regression"
 
unsigned int current_gen = 1
 
int pop_size = 100
 
int max_gens = 100
 
int max_stall = 0
 
int max_time = -1
 
unsigned int max_depth = 5
 
unsigned int max_size = 50
 
vector< stringobjectives {"scorer","linear_complexity"}
 
string bandit = "thompson"
 
string sel = "lexicase"
 
string surv = "nsga2"
 
std::unordered_map< string, float > functions
 
int num_islands =1
 
bool use_arch =false
 
bool val_from_arch =true
 
bool constants_simplification =true
 
bool inexact_simplification =true
 
std::map< std::string, float > mutation_probs
 
float cx_prob =0.2
 cross rate for variation
 
float mig_prob = 0.05
 
string scorer ="mse"
 actual loss function used, determined by error
 
vector< int > classes = vector<int>()
 class labels
 
vector< float > class_weights = vector<float>()
 weights for each class
 
vector< float > sample_weights = vector<float>()
 weights for each sample
 
bool classification = false
 
unsigned int n_classes = 0
 
bool shuffle_split = false
 
float validation_size = 0.75
 
vector< stringfeature_names = {}
 
vector< stringfeature_types = {}
 
float batch_size = 0.0
 
bool weights_init =true
 
string load_population = ""
 
string save_population = ""
 
string logfile = ""
 
int n_jobs = 1
 number of parallel jobs -1 use all threads; 0 use same as number of islands; positive number specify the amouut of threads
 

Detailed Description

Definition at line 19 of file params.h.

Constructor & Destructor Documentation

◆ Parameters()

Brush::Parameters::Parameters ( )
inline

Definition at line 95 of file params.h.

◆ ~Parameters()

Brush::Parameters::~Parameters ( )
inline

Definition at line 96 of file params.h.

Member Function Documentation

◆ get_bandit()

string Brush::Parameters::get_bandit ( )
inline

Definition at line 113 of file params.h.

Here is the caller graph for this function:

◆ get_batch_size()

float Brush::Parameters::get_batch_size ( )
inline

Definition at line 246 of file params.h.

Here is the caller graph for this function:

◆ get_class_weights()

vector< float > Brush::Parameters::get_class_weights ( )
inline

Definition at line 233 of file params.h.

Here is the caller graph for this function:

◆ get_classification()

bool Brush::Parameters::get_classification ( )
inline

Definition at line 185 of file params.h.

Here is the caller graph for this function:

◆ get_constants_simplification()

bool Brush::Parameters::get_constants_simplification ( )
inline

Definition at line 191 of file params.h.

Here is the caller graph for this function:

◆ get_current_gen()

unsigned int Brush::Parameters::get_current_gen ( )
inline

Definition at line 134 of file params.h.

Here is the caller graph for this function:

◆ get_cx_prob()

float Brush::Parameters::get_cx_prob ( )
inline

Definition at line 173 of file params.h.

Here is the caller graph for this function:

◆ get_feature_names()

vector< string > Brush::Parameters::get_feature_names ( )
inline

Definition at line 240 of file params.h.

Here is the caller graph for this function:

◆ get_feature_types()

vector< string > Brush::Parameters::get_feature_types ( )
inline

Definition at line 243 of file params.h.

◆ get_functions()

std::unordered_map< std::string, float > Brush::Parameters::get_functions ( )
inline

Definition at line 252 of file params.h.

Here is the caller graph for this function:

◆ get_inexact_simplification()

bool Brush::Parameters::get_inexact_simplification ( )
inline

Definition at line 194 of file params.h.

Here is the caller graph for this function:

◆ get_load_population()

string Brush::Parameters::get_load_population ( )
inline

Definition at line 125 of file params.h.

Here is the caller graph for this function:

◆ get_logfile()

string Brush::Parameters::get_logfile ( )
inline

Definition at line 130 of file params.h.

Here is the caller graph for this function:

◆ get_max_depth()

unsigned Brush::Parameters::get_max_depth ( ) const
inline

Definition at line 141 of file params.h.

Here is the caller graph for this function:

◆ get_max_gens()

int Brush::Parameters::get_max_gens ( )
inline

Definition at line 110 of file params.h.

Here is the caller graph for this function:

◆ get_max_size()

unsigned Brush::Parameters::get_max_size ( ) const
inline

Definition at line 147 of file params.h.

Here is the caller graph for this function:

◆ get_max_stall()

int Brush::Parameters::get_max_stall ( )
inline

Definition at line 116 of file params.h.

Here is the caller graph for this function:

◆ get_max_time()

int Brush::Parameters::get_max_time ( )
inline

Definition at line 119 of file params.h.

Here is the caller graph for this function:

◆ get_mig_prob()

float Brush::Parameters::get_mig_prob ( )
inline

Definition at line 176 of file params.h.

Here is the caller graph for this function:

◆ get_mutation_probs()

std::map< std::string, float > Brush::Parameters::get_mutation_probs ( )
inline

Definition at line 249 of file params.h.

Here is the caller graph for this function:

◆ get_n_classes()

unsigned int Brush::Parameters::get_n_classes ( )
inline

Definition at line 232 of file params.h.

Here is the caller graph for this function:

◆ get_n_jobs()

int Brush::Parameters::get_n_jobs ( )
inline

Definition at line 144 of file params.h.

Here is the caller graph for this function:

◆ get_num_islands()

int Brush::Parameters::get_num_islands ( )
inline

Definition at line 138 of file params.h.

Here is the caller graph for this function:

◆ get_objectives()

vector< string > Brush::Parameters::get_objectives ( ) const
inline

Definition at line 150 of file params.h.

Here is the caller graph for this function:

◆ get_pop_size()

int Brush::Parameters::get_pop_size ( )
inline

Definition at line 107 of file params.h.

Here is the caller graph for this function:

◆ get_random_state()

int Brush::Parameters::get_random_state ( )
inline

Definition at line 104 of file params.h.

Here is the caller graph for this function:

◆ get_sample_weights()

vector< float > Brush::Parameters::get_sample_weights ( )
inline

Definition at line 234 of file params.h.

Here is the caller graph for this function:

◆ get_save_population()

string Brush::Parameters::get_save_population ( )
inline

Definition at line 128 of file params.h.

Here is the caller graph for this function:

◆ get_scorer()

string Brush::Parameters::get_scorer ( )
inline

Definition at line 122 of file params.h.

Here is the caller graph for this function:

◆ get_sel()

string Brush::Parameters::get_sel ( )
inline

Definition at line 167 of file params.h.

Here is the caller graph for this function:

◆ get_shuffle_split()

bool Brush::Parameters::get_shuffle_split ( )
inline

Definition at line 188 of file params.h.

Here is the caller graph for this function:

◆ get_surv()

string Brush::Parameters::get_surv ( )
inline

Definition at line 170 of file params.h.

Here is the caller graph for this function:

◆ get_use_arch()

bool Brush::Parameters::get_use_arch ( )
inline

Definition at line 179 of file params.h.

Here is the caller graph for this function:

◆ get_val_from_arch()

bool Brush::Parameters::get_val_from_arch ( )
inline

Definition at line 182 of file params.h.

Here is the caller graph for this function:

◆ get_validation_size()

float Brush::Parameters::get_validation_size ( )
inline

Definition at line 237 of file params.h.

Here is the caller graph for this function:

◆ get_verbosity()

int Brush::Parameters::get_verbosity ( )
inline

Definition at line 101 of file params.h.

Here is the caller graph for this function:

◆ get_weights_init()

bool Brush::Parameters::get_weights_init ( )
inline

Definition at line 197 of file params.h.

Here is the caller graph for this function:

◆ set_bandit()

void Brush::Parameters::set_bandit ( string new_bandit)
inline

Definition at line 112 of file params.h.

Here is the caller graph for this function:

◆ set_batch_size()

void Brush::Parameters::set_batch_size ( float c)
inline

Definition at line 245 of file params.h.

Here is the caller graph for this function:

◆ set_class_weights()

void Brush::Parameters::set_class_weights ( const ArrayXf & y)
inline

Definition at line 218 of file params.h.

Here is the caller graph for this function:

◆ set_classification()

void Brush::Parameters::set_classification ( bool c)
inline

Definition at line 184 of file params.h.

Here is the caller graph for this function:

◆ set_constants_simplification()

void Brush::Parameters::set_constants_simplification ( bool cs)
inline

Definition at line 190 of file params.h.

Here is the caller graph for this function:

◆ set_current_gen()

void Brush::Parameters::set_current_gen ( unsigned int gen)
inline

Definition at line 133 of file params.h.

Here is the caller graph for this function:

◆ set_cx_prob()

void Brush::Parameters::set_cx_prob ( float new_cx_prob)
inline

Definition at line 172 of file params.h.

Here is the caller graph for this function:

◆ set_feature_names()

void Brush::Parameters::set_feature_names ( vector< string > vn)
inline

Definition at line 239 of file params.h.

Here is the caller graph for this function:

◆ set_feature_types()

void Brush::Parameters::set_feature_types ( vector< string > ft)
inline

Definition at line 242 of file params.h.

◆ set_functions()

void Brush::Parameters::set_functions ( std::unordered_map< std::string, float > new_functions)
inline

Definition at line 251 of file params.h.

Here is the caller graph for this function:

◆ set_inexact_simplification()

void Brush::Parameters::set_inexact_simplification ( bool is)
inline

Definition at line 193 of file params.h.

Here is the caller graph for this function:

◆ set_load_population()

void Brush::Parameters::set_load_population ( string new_load_population)
inline

Definition at line 124 of file params.h.

Here is the caller graph for this function:

◆ set_logfile()

void Brush::Parameters::set_logfile ( string s)
inline

Definition at line 131 of file params.h.

Here is the caller graph for this function:

◆ set_max_depth()

void Brush::Parameters::set_max_depth ( unsigned new_max_depth)
inline

Definition at line 140 of file params.h.

Here is the caller graph for this function:

◆ set_max_gens()

void Brush::Parameters::set_max_gens ( int new_max_gens)
inline

Definition at line 109 of file params.h.

Here is the caller graph for this function:

◆ set_max_size()

void Brush::Parameters::set_max_size ( unsigned new_max_size)
inline

Definition at line 146 of file params.h.

Here is the caller graph for this function:

◆ set_max_stall()

void Brush::Parameters::set_max_stall ( int new_max_stall)
inline

Definition at line 115 of file params.h.

Here is the caller graph for this function:

◆ set_max_time()

void Brush::Parameters::set_max_time ( int new_max_time)
inline

Definition at line 118 of file params.h.

Here is the caller graph for this function:

◆ set_mig_prob()

void Brush::Parameters::set_mig_prob ( float new_mig_prob)
inline

Definition at line 175 of file params.h.

Here is the caller graph for this function:

◆ set_mutation_probs()

void Brush::Parameters::set_mutation_probs ( std::map< std::string, float > new_mutation_probs)
inline

Definition at line 248 of file params.h.

Here is the caller graph for this function:

◆ set_n_classes()

void Brush::Parameters::set_n_classes ( const ArrayXf & y)
inline

Definition at line 199 of file params.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_n_jobs()

void Brush::Parameters::set_n_jobs ( int new_n_jobs)
inline

Definition at line 143 of file params.h.

Here is the caller graph for this function:

◆ set_num_islands()

void Brush::Parameters::set_num_islands ( int new_num_islands)
inline

Definition at line 137 of file params.h.

Here is the caller graph for this function:

◆ set_objectives()

void Brush::Parameters::set_objectives ( vector< string > new_objectives)
inline

Definition at line 149 of file params.h.

Here is the caller graph for this function:

◆ set_pop_size()

void Brush::Parameters::set_pop_size ( int new_pop_size)
inline

Definition at line 106 of file params.h.

Here is the caller graph for this function:

◆ set_random_state()

void Brush::Parameters::set_random_state ( int new_random_state)
inline

Definition at line 103 of file params.h.

Here is the caller graph for this function:

◆ set_sample_weights()

void Brush::Parameters::set_sample_weights ( const ArrayXf & y)
inline

Definition at line 225 of file params.h.

Here is the caller graph for this function:

◆ set_save_population()

void Brush::Parameters::set_save_population ( string new_save_population)
inline

Definition at line 127 of file params.h.

Here is the caller graph for this function:

◆ set_scorer()

void Brush::Parameters::set_scorer ( string new_scorer)
inline

Definition at line 121 of file params.h.

Here is the caller graph for this function:

◆ set_sel()

void Brush::Parameters::set_sel ( string new_sel)
inline

Definition at line 166 of file params.h.

Here is the caller graph for this function:

◆ set_shuffle_split()

void Brush::Parameters::set_shuffle_split ( bool shuff)
inline

Definition at line 187 of file params.h.

Here is the caller graph for this function:

◆ set_surv()

void Brush::Parameters::set_surv ( string new_surv)
inline

Definition at line 169 of file params.h.

Here is the caller graph for this function:

◆ set_use_arch()

void Brush::Parameters::set_use_arch ( bool new_use_arch)
inline

Definition at line 178 of file params.h.

Here is the caller graph for this function:

◆ set_val_from_arch()

void Brush::Parameters::set_val_from_arch ( bool new_val_from_arch)
inline

Definition at line 181 of file params.h.

Here is the caller graph for this function:

◆ set_validation_size()

void Brush::Parameters::set_validation_size ( float s)
inline

Definition at line 236 of file params.h.

Here is the caller graph for this function:

◆ set_verbosity()

void Brush::Parameters::set_verbosity ( int new_verbosity)
inline

Definition at line 99 of file params.h.

Here is the caller graph for this function:

◆ set_weights_init()

void Brush::Parameters::set_weights_init ( bool init)
inline

Definition at line 196 of file params.h.

Here is the caller graph for this function:

Member Data Documentation

◆ bandit

string Brush::Parameters::bandit = "thompson"

Definition at line 41 of file params.h.

◆ batch_size

float Brush::Parameters::batch_size = 0.0

Definition at line 85 of file params.h.

◆ class_weights

vector<float> Brush::Parameters::class_weights = vector<float>()

weights for each class

Definition at line 72 of file params.h.

◆ classes

vector<int> Brush::Parameters::classes = vector<int>()

class labels

Definition at line 71 of file params.h.

◆ classification

bool Brush::Parameters::classification = false

Definition at line 77 of file params.h.

◆ constants_simplification

bool Brush::Parameters::constants_simplification =true

Definition at line 53 of file params.h.

◆ current_gen

unsigned int Brush::Parameters::current_gen = 1

Definition at line 29 of file params.h.

◆ cx_prob

float Brush::Parameters::cx_prob =0.2

cross rate for variation

Definition at line 66 of file params.h.

◆ feature_names

vector<string> Brush::Parameters::feature_names = {}

Definition at line 83 of file params.h.

◆ feature_types

vector<string> Brush::Parameters::feature_types = {}

Definition at line 84 of file params.h.

◆ functions

std::unordered_map<string, float> Brush::Parameters::functions

Definition at line 44 of file params.h.

◆ inexact_simplification

bool Brush::Parameters::inexact_simplification =true

Definition at line 54 of file params.h.

◆ load_population

string Brush::Parameters::load_population = ""

Definition at line 88 of file params.h.

◆ logfile

string Brush::Parameters::logfile = ""

Definition at line 91 of file params.h.

◆ max_depth

unsigned int Brush::Parameters::max_depth = 5

Definition at line 37 of file params.h.

◆ max_gens

int Brush::Parameters::max_gens = 100

Definition at line 33 of file params.h.

◆ max_size

unsigned int Brush::Parameters::max_size = 50

Definition at line 38 of file params.h.

◆ max_stall

int Brush::Parameters::max_stall = 0

Definition at line 34 of file params.h.

◆ max_time

int Brush::Parameters::max_time = -1

Definition at line 35 of file params.h.

◆ mig_prob

float Brush::Parameters::mig_prob = 0.05

Definition at line 67 of file params.h.

◆ mode

string Brush::Parameters::mode ="regression"

Definition at line 27 of file params.h.

◆ mutation_probs

std::map<std::string, float> Brush::Parameters::mutation_probs
Initial value:
= {
{"point", 0.167},
{"insert", 0.167},
{"delete", 0.167},
{"subtree", 0.167},
{"toggle_weight_on", 0.167},
{"toggle_weight_off", 0.167}
}

Definition at line 57 of file params.h.

◆ n_classes

unsigned int Brush::Parameters::n_classes = 0

Definition at line 78 of file params.h.

◆ n_jobs

int Brush::Parameters::n_jobs = 1

number of parallel jobs -1 use all threads; 0 use same as number of islands; positive number specify the amouut of threads

Definition at line 93 of file params.h.

◆ num_islands

int Brush::Parameters::num_islands =1

Definition at line 45 of file params.h.

◆ objectives

vector<string> Brush::Parameters::objectives {"scorer","linear_complexity"}

Definition at line 40 of file params.h.

◆ pop_size

int Brush::Parameters::pop_size = 100

Definition at line 32 of file params.h.

◆ random_state

int Brush::Parameters::random_state = 0

Definition at line 23 of file params.h.

◆ sample_weights

vector<float> Brush::Parameters::sample_weights = vector<float>()

weights for each sample

Definition at line 73 of file params.h.

◆ save_population

string Brush::Parameters::save_population = ""

Definition at line 89 of file params.h.

◆ scorer

string Brush::Parameters::scorer ="mse"

actual loss function used, determined by error

Definition at line 69 of file params.h.

◆ sel

string Brush::Parameters::sel = "lexicase"

Definition at line 42 of file params.h.

◆ shuffle_split

bool Brush::Parameters::shuffle_split = false

Definition at line 81 of file params.h.

◆ surv

string Brush::Parameters::surv = "nsga2"

Definition at line 43 of file params.h.

◆ use_arch

bool Brush::Parameters::use_arch =false

Definition at line 49 of file params.h.

◆ val_from_arch

bool Brush::Parameters::val_from_arch =true

Definition at line 50 of file params.h.

◆ validation_size

float Brush::Parameters::validation_size = 0.75

Definition at line 82 of file params.h.

◆ verbosity

int Brush::Parameters::verbosity = 0

Definition at line 24 of file params.h.

◆ weights_init

bool Brush::Parameters::weights_init =true

Definition at line 86 of file params.h.


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