21 #include <raft/core/handle.hpp>
124 const param& params);
145 const float* sample_weights);
168 const float* sample_weights);
189 const float* sample_weights);
207 std::vector<program>& h_progs,
212 const float* sample_weights);
RF_metrics score(const raft::handle_t &user_handle, const RandomForestClassifierF *forest, const int *ref_labels, int n_rows, const int *predictions, int verbosity=CUML_LEVEL_INFO)
void crossover(const program &prog, const program &donor, program &p_out, const param ¶ms, std::mt19937 &rng)
Perform a 'hoisted' crossover mutation using the parent and donor programs. The donor subtree selecte...
void build_program(program &p_out, const param ¶ms, std::mt19937 &rng)
Build a random program with depth atmost 10.
float get_fitness(const program &prog, const param ¶ms)
Returns precomputed fitness score of program on the host, after accounting for parsimony.
void set_fitness(const raft::handle_t &h, program_t &d_prog, program &h_prog, const param ¶ms, const int n_rows, const float *data, const float *y, const float *sample_weights)
Computes and sets the fitness scores for a single program on the given dataset.
void subtree_mutation(const program &prog, program &p_out, const param ¶ms, std::mt19937 &rng)
Performs a crossover mutation with a randomly built new program. Since crossover is 'hoisted',...
metric_t
Definition: common.h:30
void find_fitness(const raft::handle_t &h, program_t &d_prog, float *score, const param ¶ms, const int n_rows, const float *data, const float *y, const float *sample_weights)
Computes the fitness scores for a sngle program on the given dataset.
void find_batched_fitness(const raft::handle_t &h, int n_progs, program_t &d_progs, float *score, const param ¶ms, const int n_rows, const float *data, const float *y, const float *sample_weights)
Computes the fitness scores for all programs on the given dataset.
void hoist_mutation(const program &prog, program &p_out, const param ¶ms, std::mt19937 &rng)
Perform a hoist mutation on a random subtree of the given program (replace a subtree with a subtree o...
void execute(const raft::handle_t &h, const program_t &d_progs, const int n_rows, const int n_progs, const float *data, float *y_pred)
Calls the execution kernel to evaluate all programs on the given dataset.
int get_depth(const program &p_out)
Evaluates and returns the depth of the current program.
mutation_t
Definition: common.h:68
program * program_t
Definition: program.h:85
void set_batched_fitness(const raft::handle_t &h, int n_progs, program_t &d_progs, std::vector< program > &h_progs, const param ¶ms, const int n_rows, const float *data, const float *y, const float *sample_weights)
Computes and sets the fitness scores for all programs on the given dataset.
void compute_metric(const raft::handle_t &h, int n_rows, int n_progs, const float *y, const float *y_pred, const float *w, float *score, const param ¶ms)
Compute the loss based on the metric specified in the training hyperparameters. It performs a batched...
void point_mutation(const program &prog, program &p_out, const param ¶ms, std::mt19937 &rng)
Perform a point mutation on the given program(AST)
Represents a node in the syntax tree.
Definition: node.h:38
contains all the hyper-parameters for training
Definition: common.h:94
The main data structure to store the AST that represents a program in the current generation.
Definition: program.h:32
float raw_fitness_
Definition: program.h:77
metric_t metric
Definition: program.h:79
program & operator=(const program &src)
assignment operator
node * nodes
Definition: program.h:71
~program()
Destroy the program object.
int depth
Definition: program.h:75
int len
Definition: program.h:73
program(const program &src)
Copy constructor for a new program object.
mutation_t mut_type
Definition: program.h:81