18#include "taskflow/taskflow.hpp"
19#include <taskflow/algorithm/for_each.hpp>
28using namespace nlohmann;
30template <ProgramType T>
85 Engine<T> &
fit(
const Ref<const ArrayXXf>& X,
const Ref<const ArrayXf>& y)
95 auto predict(
const Ref<const ArrayXXf>& X)
101 template <ProgramType P = T>
104 template <ProgramType P = T>
129 template <ProgramType P = T>
132 template <ProgramType P = T>
holds variable type data.
The Engine class represents the core engine of the brush library.
auto predict(const Dataset &data)
auto predict_proba(const Dataset &d)
SearchSpace & get_search_space()
void print_progress(float percentage)
vector< json > get_population()
void run(Dataset &d)
train the model
Engine(Parameters &p, SearchSpace &s)
void lock_nodes(int end_depth=0, bool skip_leaves=true)
Engine< T > & fit(Dataset &data)
auto predict(const Ref< const ArrayXXf > &X)
void set_search_space(SearchSpace &space)
void set_population(vector< json > pop_vector)
Parameters & get_params()
auto predict_archive(int id, const Ref< const ArrayXXf > &X)
Individual< T > & get_best_ind()
void set_params(Parameters &p)
auto predict_proba(const Ref< const ArrayXXf > &X)
void set_is_fitted(bool f)
set flag indicating whether fit has been called
int get_archive_size()
return archive size
void unlock_nodes(int start_depth=0)
Evaluation< T > evaluator
Engine< T > & fit(const Ref< const ArrayXXf > &X, const Ref< const ArrayXf > &y)
void init()
initialize Feat object for fitting.
auto predict_proba_archive(int id, const Dataset &data)
auto predict_archive(int id, const Dataset &data)
predict on unseen data from the archive
bool update_best()
updates best score by searching in the population for the individual that best fits the given data
void log_stats(std::ofstream &log)
vector< json > get_archive(bool front)
return archive/population as string
void print_stats(std::ofstream &log, float fraction)
auto predict_proba_archive(int id, const Ref< const ArrayXXf > &X)
Class for evaluating the fitness of individuals in a population.
< nsga2 selection operator for getting the front
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(Engine< PT::Regressor >, params, best_ind, archive, pop, ss, is_fitted)
The Archive struct represents a collection of individual programs.
Holds a search space, consisting of operations and terminals and functions, and methods to sample tha...
interfaces with selection operators.