19 for (
unsigned i = 0; i<indices.size(); ++i)
44template<ProgramType T>
52 float f =
S.score(ind, train, errors, params);
62 f_v =
S.score(ind, validation, val_errors, params);
69 if (std::isnan(f) || std::isinf(f))
71 if (std::isnan(f_v) || std::isinf(f_v))
92 if (n.compare(params.
scorer)==0)
93 values.push_back(val ? f_v : f);
94 else if (n.compare(
"complexity")==0)
96 else if (n.compare(
"linear_complexity")==0)
98 else if (n.compare(
"size")==0)
100 else if (n.compare(
"depth")==0)
holds variable type data.
Dataset get_validation_data() const
ArrayXf y
length N array, the target label
Dataset get_training_data() const
void update_fitness(Population< T > &pop, int island, const Dataset &data, const Parameters ¶ms, bool fit=true, bool validation=true)
Update the fitness of individuals in a population.
void assign_fit(Individual< T > &ind, const Dataset &data, const Parameters ¶ms, bool val=false)
Assign fitness to an individual.
static std::map< std::string, float > weightsMap
set parent ids using id values
unsigned int get_complexity() const
unsigned int get_size() const
VectorXf error
training error (used in lexicase selectors)
Fitness fitness
aggregate fitness score
vector< string > get_objectives() const
void set_objectives(vector< string > objs)
unsigned int get_depth() const
unsigned int get_linear_complexity() const
Program< T > program
executable data structure
bool get_is_fitted() const
vector< size_t > get_island_indexes(int island)
vector< std::shared_ptr< Individual< T > > > individuals
#define HANDLE_ERROR_THROW(err)
< nsga2 selection operator for getting the front
Namespace containing scoring functions for evaluation metrics.
void set_linear_complexity(unsigned int new_lc)
void set_complexity(unsigned int new_c)
void set_loss_v(float f_v)
void set_depth(unsigned int new_d)
void set_values(vector< float > &v)
void set_size(unsigned int new_s)
vector< string > get_objectives() const
string scorer
actual loss function used, determined by error
Program< PType > & fit(const Dataset &d)