34 if (fit &&
ind.get_is_fitted() ==
false)
36 ind.program.fit(data);
45template<ProgramType T>
69 ind.fitness.set_loss(
f);
70 ind.fitness.set_loss_v(
f_v);
71 ind.fitness.set_size(
ind.get_size());
72 ind.fitness.set_complexity(
ind.get_complexity());
73 ind.fitness.set_depth(
ind.get_depth());
78 for (
const auto&
n :
ind.get_objectives())
80 if (
n.compare(
"error")==0)
81 values.push_back(
val ?
f_v :
f);
82 else if (
n.compare(
"complexity")==0)
83 values.push_back(
ind.program.complexity());
84 else if (
n.compare(
"size")==0)
85 values.push_back(
ind.program.size());
86 else if (
n.compare(
"depth")==0)
87 values.push_back(
ind.program.depth());
93 ind.fitness.set_values(values);
void bind_engine(py::module &m, string name)
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=false)
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.
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.
vector< string > objectives