8 #include "../dat/state.h"
12 #include "../dat/data.h"
13 #include "../params.h"
14 #include "../model/ml.h"
15 #include "../util/utils.h"
16 #include "../util/serialization.h"
21 using namespace Model;
67 void initialize(
const Parameters& params,
bool random,
int id=0);
70 MatrixXf out(
const Data& d,
bool predict=
false);
73 MatrixXf out_trace(
const Data& d, vector<Trace>& stack_trace);
76 MatrixXf state_to_phi(
State& state);
85 shared_ptr<CLabels> fit_tune(
const Data& d,
86 const Parameters& params,
bool set_default=
false);
94 shared_ptr<CLabels> predict(
const Data& d);
95 VectorXf predict_vector(
const Data& d);
96 ArrayXXf predict_proba(
const Data& d);
101 vector<string> get_features();
104 string program_str()
const;
111 void set_rank(
unsigned r);
126 unsigned int get_dim();
129 int check_dominance(
const Individual& b)
const;
132 void set_obj(
const vector<string>&);
135 unsigned int set_complexity();
138 unsigned int get_complexity()
const;
141 void clone(
Individual& cpy,
bool sameid=
true)
const;
144 void set_id(
unsigned i);
147 void set_parents(
const vector<Individual>& parents);
150 void set_parents(
const vector<int>& parents){ parent_id = parents; }
153 vector<float> get_p()
const;
156 float get_p(
const size_t i,
bool normalize=
true)
const;
159 vector<float> get_p(
const vector<size_t>& locs,
bool normalize=
false)
const;
162 void set_p(
const vector<float>& weights,
const float& fb,
163 const bool softmax_norm=
false);
166 std::map<char,size_t> get_max_state_size();
169 void save(
string filename);
171 void load(
string filename);
173 typedef Array<bool, Dynamic, Dynamic, RowMajor>
ArrayXXb;
data holding X, y, and Z data
individual programs in the population
vector< float > w
weights from ML training on program output
void set_parents(const vector< int > &parents)
set parent ids using id values
float fairness
aggregate fairness score
unsigned int dim
dimensionality of individual
vector< float > p
probability of variation of subprograms
VectorXf yhat
current output
vector< char > dtypes
the data types of each column of the
MatrixXf Phi
transformation output of program
float fitness
aggregate fitness score
NodeVector program
executable data structure
vector< float > obj
objectives for use with Pareto selection
shared_ptr< ML > ml
ML model, trained on Phi.
void tune(const Data &d, const Parameters ¶ms)
tunes an ML model to the data after transformation
vector< unsigned int > dominated
individual indices this dominates
Array< bool, Dynamic, Dynamic, RowMajor > ArrayXXb
unsigned int dcounter
number of individuals this dominates
VectorXf error
training error
vector< int > parent_id
ids of parents
float crowd_dist
crowding distance on the Pareto front
unsigned int rank
pareto front rank
float fairness_v
aggregate validation fairness score
string eqn
equation form of the program
float fitness_v
aggregate validation fitness score
unsigned int complexity
the complexity of the program.
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(Parameters, pop_size, gens, current_gen, ml, classification, max_stall, otypes, ttypes, otype, verbosity, term_weights, op_weights, fn_str, terminals, longitudinalMap, max_depth, max_size, max_dim, erc, num_features, objectives, shuffle, split, dtypes, feedback, n_classes, cross_rate, classes, class_weights, sample_weights, scorer, scorer_, feature_names, backprop, hillclimb, max_time, use_batch, residual_xo, stagewise_xo, stagewise_xo_tol, corr_delete_mutate, root_xo_rate, softmax_norm, normalize, protected_groups, tune_initial, tune_final)
contains various types of State actually used by feat
holds the hyperparameters for Feat.
an extension of a vector of unique pointers to nodes