Feat C++ API
A feature engineering automation tool
FT::Parameters Class Reference

holds the hyperparameters for Feat. More...

#include <params.h>

Collaboration diagram for FT::Parameters:

Classes

struct  BP
 
struct  HC
 

Public Member Functions

 Parameters ()
 
 ~Parameters ()
 
void init (const MatrixXf &X, const VectorXf &y)
 
void set_current_gen (int g)
 sets current generation More...
 
void set_scorer (string sc="", bool initialized=false)
 sets scorer type More...
 
void set_term_weights (const vector< float > &w)
 sets weights for terminals. More...
 
void set_op_weights ()
 sets weights for operators. More...
 
std::unique_ptr< NodecreateNode (std::string str, float d_val=0, bool b_val=false, size_t loc=0, string name="")
 return unique pointer to a node based on the string passed More...
 
vector< string > get_functions ()
 returns the set of functions to use determined at run-time. More...
 
void set_functions (const vector< string > &fns)
 sets available functions and verifies output types. More...
 
void updateSize ()
 max_size is max_dim binary trees of max_depth More...
 
void set_max_depth (unsigned int max_depth)
 set max depth of programs More...
 
void set_max_dim (unsigned int max_dim)
 set maximum dimensionality of programs More...
 
void set_terminals (int nf, const LongData &Z)
 set the terminals with longitudinal data More...
 
void set_terminals (int nf)
 
void set_feature_names (string fn)
 
string get_feature_names ()
 
string get_protected_groups ()
 
void set_protected_groups (string fn)
 
auto get_objectives ()
 get objectives as comma-delimited string More...
 
void set_objectives (const vector< string > &obj)
 set the objectives More...
 
void set_verbosity (int verbosity)
 set level of debug info More...
 
void set_otype (char ot)
 
void set_ttypes ()
 
void set_otypes (bool terminals_set=false)
 set the output types of programs More...
 
void set_classes (const VectorXf &y)
 sets the number of classes based on target vector y. More...
 
void set_sample_weights (VectorXf &y)
 sets the weights of each sample (and class weights) More...
 
void initialize_node_map ()
 defines a map of function names to their respective nodes. More...
 

Public Attributes

std::map< std::string, Node * > node_map
 
int random_state
 random seed More...
 
int pop_size = 100
 population size More...
 
int gens = 100
 max generations More...
 
int current_gen
 holds current generation More...
 
string ml
 machine learner used with Feat More...
 
bool classification = false
 flag to conduct classification rather than More...
 
int max_stall = 0
 maximum stall in learning, in generations More...
 
vector< char > otypes
 program output types ('f', 'b') More...
 
vector< char > ttypes
 program terminal types ('f', 'b') More...
 
char otype
 user parameter for output type setup More...
 
int verbosity = 0
 
vector< float > term_weights
 probability weighting of terminals More...
 
vector< float > op_weights
 probability weighting of functions More...
 
NodeVector functions
 function nodes available in programs More...
 
NodeVector terminals
 terminal nodes available in programs vector storing longitudinal data keys More...
 
vector< std::string > longitudinalMap
 
unsigned int max_depth = 3
 max depth of programs More...
 
unsigned int max_size
 max size of programs (length) More...
 
unsigned int max_dim = 10
 maximum dimensionality of programs More...
 
bool erc = false
 whether to include constants for terminals More...
 
unsigned num_features
 number of features More...
 
vector< string > objectives {"fitness","complexity"}
 Pareto objectives. More...
 
bool shuffle = true
 option to shuffle the data More...
 
float split = 0.75
 fraction of data to use for training More...
 
vector< char > dtypes
 data types of input parameters More...
 
float feedback = 0.5
 strength of ml feedback on probabilities More...
 
unsigned int n_classes
 number of classes for classification More...
 
float cross_rate
 cross rate for variation More...
 
vector< int > classes
 class labels More...
 
vector< float > class_weights
 weights for each class More...
 
vector< float > sample_weights
 weights for each sample More...
 
string scorer
 loss function argument More...
 
string scorer_
 actual loss function used, determined by scorer More...
 
vector< string > feature_names
 names of features More...
 
bool backprop = false
 turns on backpropagation More...
 
bool hillclimb = false
 turns on parameter hill climbing More...
 
int max_time = -1
 max time for fit method More...
 
bool use_batch = false
 whether to use mini batch for training More...
 
bool residual_xo =false
 use residual crossover
More...
 
bool stagewise_xo =false
 use stagewise crossover
More...
 
bool stagewise_xo_tol =true
 use stagewise crossover
More...
 
bool corr_delete_mutate =false
 use correlation delete mutation
More...
 
float root_xo_rate = 0.5
 crossover
More...
 
bool softmax_norm
 use softmax norm on probabilities More...
 
bool normalize
 whether to normalize the input data More...
 
vector< bool > protected_groups
 protected attributes in X More...
 
bool tune_initial
 tune initial ML model More...
 
bool tune_final
 tune final ML model string of comma-delimited operator names, used to choose functions More...
 
string fn_str
 
int n_jobs = 1
 number of parallel jobs More...
 
BP bp
 backprop parameters More...
 
HC hc
 stochastic hill climbing parameters
More...
 

Detailed Description

holds the hyperparameters for Feat.

Definition at line 24 of file params.h.

Constructor & Destructor Documentation

◆ Parameters()

FT::Parameters::Parameters ( )

Definition at line 65 of file params.cc.

◆ ~Parameters()

FT::Parameters::~Parameters ( )
inline

Definition at line 114 of file params.h.

Member Function Documentation

◆ createNode()

std::unique_ptr< Node > FT::Parameters::createNode ( std::string  str,
float  d_val = 0,
bool  b_val = false,
size_t  loc = 0,
string  name = "" 
)

return unique pointer to a node based on the string passed

Definition at line 314 of file params.cc.

◆ get_feature_names()

string FT::Parameters::get_feature_names ( )

Definition at line 439 of file params.cc.

◆ get_functions()

vector<string> FT::Parameters::get_functions ( )

returns the set of functions to use determined at run-time.

◆ get_objectives()

auto FT::Parameters::get_objectives ( )
inline

get objectives as comma-delimited string

Definition at line 164 of file params.h.

◆ get_protected_groups()

string FT::Parameters::get_protected_groups ( )

Definition at line 409 of file params.cc.

◆ init()

void FT::Parameters::init ( const MatrixXf &  X,
const VectorXf &  y 
)

checks initial parameter settings before training. make sure ml choice is valid for problem type. make sure scorer is set. for classification, check clases and find number.

Definition at line 82 of file params.cc.

◆ initialize_node_map()

void FT::Parameters::initialize_node_map ( )

defines a map of function names to their respective nodes.

◆ set_classes()

void FT::Parameters::set_classes ( const VectorXf &  y)

sets the number of classes based on target vector y.

Definition at line 718 of file params.cc.

◆ set_current_gen()

void FT::Parameters::set_current_gen ( int  g)

sets current generation

Definition at line 109 of file params.cc.

◆ set_feature_names()

void FT::Parameters::set_feature_names ( string  fn)

Definition at line 421 of file params.cc.

◆ set_functions()

void FT::Parameters::set_functions ( const vector< string > &  fns)

sets available functions and verifies output types.

◆ set_max_depth()

void FT::Parameters::set_max_depth ( unsigned int  max_depth)

set max depth of programs

Definition at line 210 of file params.cc.

◆ set_max_dim()

void FT::Parameters::set_max_dim ( unsigned int  max_dim)

set maximum dimensionality of programs

Definition at line 217 of file params.cc.

◆ set_objectives()

void FT::Parameters::set_objectives ( const vector< string > &  obj)

set the objectives

Input: obj, a comma-separated list of objectives

Definition at line 692 of file params.cc.

◆ set_op_weights()

void FT::Parameters::set_op_weights ( )

sets weights for operators.

◆ set_otype()

void FT::Parameters::set_otype ( char  ot)

Definition at line 223 of file params.cc.

◆ set_otypes()

void FT::Parameters::set_otypes ( bool  terminals_set = false)

set the output types of programs

Definition at line 237 of file params.cc.

◆ set_protected_groups()

void FT::Parameters::set_protected_groups ( string  fn)

Definition at line 386 of file params.cc.

◆ set_sample_weights()

void FT::Parameters::set_sample_weights ( VectorXf &  y)

sets the weights of each sample (and class weights)

Definition at line 749 of file params.cc.

◆ set_scorer()

void FT::Parameters::set_scorer ( string  sc = "",
bool  initialized = false 
)

sets scorer type

Definition at line 112 of file params.cc.

◆ set_term_weights()

void FT::Parameters::set_term_weights ( const vector< float > &  w)

sets weights for terminals.

Definition at line 144 of file params.cc.

◆ set_terminals() [1/2]

void FT::Parameters::set_terminals ( int  nf)
inline

Definition at line 155 of file params.h.

◆ set_terminals() [2/2]

void FT::Parameters::set_terminals ( int  nf,
const LongData Z 
)

set the terminals with longitudinal data

Definition at line 659 of file params.cc.

◆ set_ttypes()

void FT::Parameters::set_ttypes ( )

Definition at line 225 of file params.cc.

◆ set_verbosity()

void FT::Parameters::set_verbosity ( int  verbosity)

set level of debug info

Definition at line 712 of file params.cc.

◆ updateSize()

void FT::Parameters::updateSize ( )

max_size is max_dim binary trees of max_depth

Definition at line 204 of file params.cc.

Member Data Documentation

◆ backprop

bool FT::Parameters::backprop = false

turns on backpropagation

Definition at line 65 of file params.h.

◆ bp

BP FT::Parameters::bp

backprop parameters

Definition at line 92 of file params.h.

◆ class_weights

vector<float> FT::Parameters::class_weights

weights for each class

Definition at line 60 of file params.h.

◆ classes

vector<int> FT::Parameters::classes

class labels

Definition at line 59 of file params.h.

◆ classification

bool FT::Parameters::classification = false

flag to conduct classification rather than

Definition at line 32 of file params.h.

◆ corr_delete_mutate

bool FT::Parameters::corr_delete_mutate =false

use correlation delete mutation

Definition at line 72 of file params.h.

◆ cross_rate

float FT::Parameters::cross_rate

cross rate for variation

Definition at line 58 of file params.h.

◆ current_gen

int FT::Parameters::current_gen

holds current generation

Definition at line 30 of file params.h.

◆ dtypes

vector<char> FT::Parameters::dtypes

data types of input parameters

Definition at line 55 of file params.h.

◆ erc

bool FT::Parameters::erc = false

whether to include constants for terminals

Definition at line 50 of file params.h.

◆ feature_names

vector<string> FT::Parameters::feature_names

names of features

Definition at line 64 of file params.h.

◆ feedback

float FT::Parameters::feedback = 0.5

strength of ml feedback on probabilities

Definition at line 56 of file params.h.

◆ fn_str

string FT::Parameters::fn_str

Definition at line 80 of file params.h.

◆ functions

NodeVector FT::Parameters::functions

function nodes available in programs

Definition at line 42 of file params.h.

◆ gens

int FT::Parameters::gens = 100

max generations

Definition at line 29 of file params.h.

◆ hc

HC FT::Parameters::hc

stochastic hill climbing parameters

Definition at line 102 of file params.h.

◆ hillclimb

bool FT::Parameters::hillclimb = false

turns on parameter hill climbing

Definition at line 66 of file params.h.

◆ longitudinalMap

vector<std::string> FT::Parameters::longitudinalMap

Definition at line 45 of file params.h.

◆ max_depth

unsigned int FT::Parameters::max_depth = 3

max depth of programs

Definition at line 47 of file params.h.

◆ max_dim

unsigned int FT::Parameters::max_dim = 10

maximum dimensionality of programs

Definition at line 49 of file params.h.

◆ max_size

unsigned int FT::Parameters::max_size

max size of programs (length)

Definition at line 48 of file params.h.

◆ max_stall

int FT::Parameters::max_stall = 0

maximum stall in learning, in generations

Definition at line 33 of file params.h.

◆ max_time

int FT::Parameters::max_time = -1

max time for fit method

Definition at line 67 of file params.h.

◆ ml

string FT::Parameters::ml

machine learner used with Feat

Definition at line 31 of file params.h.

◆ n_classes

unsigned int FT::Parameters::n_classes

number of classes for classification

Definition at line 57 of file params.h.

◆ n_jobs

int FT::Parameters::n_jobs = 1

number of parallel jobs

Definition at line 81 of file params.h.

◆ node_map

std::map<std::string, Node*> FT::Parameters::node_map

Definition at line 26 of file params.h.

◆ normalize

bool FT::Parameters::normalize

whether to normalize the input data

Definition at line 75 of file params.h.

◆ num_features

unsigned FT::Parameters::num_features

number of features

Definition at line 51 of file params.h.

◆ objectives

vector<string> FT::Parameters::objectives {"fitness","complexity"}

Pareto objectives.

Definition at line 52 of file params.h.

◆ op_weights

vector<float> FT::Parameters::op_weights

probability weighting of functions

Definition at line 41 of file params.h.

◆ otype

char FT::Parameters::otype

user parameter for output type setup

Definition at line 36 of file params.h.

◆ otypes

vector<char> FT::Parameters::otypes

program output types ('f', 'b')

Definition at line 34 of file params.h.

◆ pop_size

int FT::Parameters::pop_size = 100

population size

Definition at line 28 of file params.h.

◆ protected_groups

vector<bool> FT::Parameters::protected_groups

protected attributes in X

Definition at line 76 of file params.h.

◆ random_state

int FT::Parameters::random_state

random seed

Definition at line 27 of file params.h.

◆ residual_xo

bool FT::Parameters::residual_xo =false

use residual crossover

Definition at line 69 of file params.h.

◆ root_xo_rate

float FT::Parameters::root_xo_rate = 0.5

crossover

Definition at line 73 of file params.h.

◆ sample_weights

vector<float> FT::Parameters::sample_weights

weights for each sample

Definition at line 61 of file params.h.

◆ scorer

string FT::Parameters::scorer

loss function argument

Definition at line 62 of file params.h.

◆ scorer_

string FT::Parameters::scorer_

actual loss function used, determined by scorer

Definition at line 63 of file params.h.

◆ shuffle

bool FT::Parameters::shuffle = true

option to shuffle the data

Definition at line 53 of file params.h.

◆ softmax_norm

bool FT::Parameters::softmax_norm

use softmax norm on probabilities

Definition at line 74 of file params.h.

◆ split

float FT::Parameters::split = 0.75

fraction of data to use for training

Definition at line 54 of file params.h.

◆ stagewise_xo

bool FT::Parameters::stagewise_xo =false

use stagewise crossover

Definition at line 70 of file params.h.

◆ stagewise_xo_tol

bool FT::Parameters::stagewise_xo_tol =true

use stagewise crossover

Definition at line 71 of file params.h.

◆ term_weights

vector<float> FT::Parameters::term_weights

probability weighting of terminals

Definition at line 40 of file params.h.

◆ terminals

NodeVector FT::Parameters::terminals

terminal nodes available in programs vector storing longitudinal data keys

Definition at line 43 of file params.h.

◆ ttypes

vector<char> FT::Parameters::ttypes

program terminal types ('f', 'b')

Definition at line 35 of file params.h.

◆ tune_final

bool FT::Parameters::tune_final

tune final ML model string of comma-delimited operator names, used to choose functions

Definition at line 78 of file params.h.

◆ tune_initial

bool FT::Parameters::tune_initial

tune initial ML model

Definition at line 77 of file params.h.

◆ use_batch

bool FT::Parameters::use_batch = false

whether to use mini batch for training

Definition at line 68 of file params.h.

◆ verbosity

int FT::Parameters::verbosity = 0

amount of printing. 0: none, 1: minimal, 2: all

Definition at line 39 of file params.h.


The documentation for this class was generated from the following files: