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

Defines a population of programs and functions for constructing them. More...

#include <population.h>

Collaboration diagram for FT::Pop::Population:

Classes

struct  SameFitComplexity
 check for same fitness and complexity to filter uniqueness. More...
 
struct  SortComplexity
 Sort population in increasing complexity. More...
 

Public Member Functions

 Population (int p=0)
 
 ~Population ()
 
void init (const Individual &starting_model, const Parameters &params, bool random=false, string filename="")
 initialize population of programs with a starting model and/or from file More...
 
void resize (int pop_size)
 update individual vector size More...
 
void update (vector< size_t > survivors)
 reduce programs to the indices in survivors. More...
 
int size ()
 returns population size More...
 
void add (Individual &)
 adds a program to the population. More...
 
const Individual operator[] (size_t i) const
 setting and getting from individuals vector More...
 
const Individualoperator[] (size_t i)
 
string print_eqns (bool just_offspring=false, string sep="\n")
 return population equations. More...
 
vector< size_t > sorted_front (unsigned)
 return complexity-sorted Pareto front indices. More...
 
void save (string filename)
 
void load (string filename)
 

Public Attributes

vector< Individualindividuals
 individual programs More...
 

Detailed Description

Defines a population of programs and functions for constructing them.

Definition at line 27 of file population.h.

Constructor & Destructor Documentation

◆ Population()

FT::Pop::Population::Population ( int  p = 0)

Definition at line 13 of file population.cc.

◆ ~Population()

FT::Pop::Population::~Population ( )

Definition at line 22 of file population.cc.

Member Function Documentation

◆ add()

void FT::Pop::Population::add ( Individual ind)

adds a program to the population.

adds ind to individuals, giving it an open location and bookeeping.

Definition at line 112 of file population.cc.

◆ init()

void FT::Pop::Population::init ( const Individual starting_model,
const Parameters params,
bool  random = false,
string  filename = "" 
)

initialize population of programs with a starting model and/or from file

create random programs in the population, seeded by initial model weights and potentially saved models

Definition at line 38 of file population.cc.

◆ load()

void FT::Pop::Population::load ( string  filename)

Definition at line 165 of file population.cc.

◆ operator[]() [1/2]

const Individual & FT::Pop::Population::operator[] ( size_t  i)

Definition at line 35 of file population.cc.

◆ operator[]() [2/2]

const Individual FT::Pop::Population::operator[] ( size_t  i) const

setting and getting from individuals vector

Definition at line 33 of file population.cc.

◆ print_eqns()

string FT::Pop::Population::print_eqns ( bool  just_offspring = false,
string  sep = "\n" 
)

return population equations.

Definition at line 121 of file population.cc.

◆ resize()

void FT::Pop::Population::resize ( int  pop_size)

update individual vector size

Definition at line 25 of file population.cc.

◆ save()

void FT::Pop::Population::save ( string  filename)

Definition at line 150 of file population.cc.

◆ size()

int FT::Pop::Population::size ( )

returns population size

Definition at line 31 of file population.cc.

◆ sorted_front()

vector< size_t > FT::Pop::Population::sorted_front ( unsigned  rank = 1)

return complexity-sorted Pareto front indices.

Definition at line 135 of file population.cc.

◆ update()

void FT::Pop::Population::update ( vector< size_t >  survivors)

reduce programs to the indices in survivors.

cull population down to survivor indices.

Definition at line 97 of file population.cc.

Member Data Documentation

◆ individuals

vector<Individual> FT::Pop::Population::individuals

individual programs

Definition at line 29 of file population.h.


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