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

an extension of a vector of unique pointers to nodes More...

#include <nodevector.h>

Inheritance diagram for FT::Pop::NodeVector:
Collaboration diagram for FT::Pop::NodeVector:

Public Member Functions

 NodeVector ()
 
 ~NodeVector ()
 
 NodeVector (const NodeVector &other)
 
 NodeVector (NodeVector &&other)
 
NodeVectoroperator= (NodeVector const &other)
 
NodeVectoroperator= (NodeVector &&other)
 
vector< Node * > get_data (int start=0, int end=0)
 returns vector of raw pointers to nodes in [start,end], or all if both are zero More...
 
vector< size_t > roots () const
 returns indices of root nodes More...
 
size_t subtree (size_t i, char otype='0', string indent="> ") const
 
void set_weights (vector< vector< float >> &weights)
 
vector< vector< float > > get_weights ()
 
bool is_valid_program (unsigned num_features, vector< string > longitudinalMap)
 
void make_tree (const NodeVector &functions, const NodeVector &terminals, int max_d, const vector< float > &term_weights, const vector< float > &op_weights, char otype, const vector< char > &term_types)
 
void make_program (const NodeVector &functions, const NodeVector &terminals, int max_d, const vector< float > &term_weights, const vector< float > &op_weights, int dim, char otype, vector< string > longitudinalMap, const vector< char > &term_types)
 

Detailed Description

an extension of a vector of unique pointers to nodes

Definition at line 23 of file nodevector.h.

Constructor & Destructor Documentation

◆ NodeVector() [1/3]

FT::Pop::NodeVector::NodeVector ( )
default

◆ ~NodeVector()

FT::Pop::NodeVector::~NodeVector ( )
default

◆ NodeVector() [2/3]

FT::Pop::NodeVector::NodeVector ( const NodeVector other)

Definition at line 20 of file nodevector.cc.

◆ NodeVector() [3/3]

FT::Pop::NodeVector::NodeVector ( NodeVector &&  other)
default

Member Function Documentation

◆ get_data()

vector< Node * > FT::Pop::NodeVector::get_data ( int  start = 0,
int  end = 0 
)

returns vector of raw pointers to nodes in [start,end], or all if both are zero

Definition at line 38 of file nodevector.cc.

◆ get_weights()

vector< vector< float > > FT::Pop::NodeVector::get_weights ( )

Definition at line 189 of file nodevector.cc.

◆ is_valid_program()

bool FT::Pop::NodeVector::is_valid_program ( unsigned  num_features,
vector< string >  longitudinalMap 
)

checks whether program fulfills all its arities.

Definition at line 202 of file nodevector.cc.

◆ make_program()

void FT::Pop::NodeVector::make_program ( const NodeVector functions,
const NodeVector terminals,
int  max_d,
const vector< float > &  term_weights,
const vector< float > &  op_weights,
int  dim,
char  otype,
vector< string >  longitudinalMap,
const vector< char > &  term_types 
)

Definition at line 368 of file nodevector.cc.

◆ make_tree()

void FT::Pop::NodeVector::make_tree ( const NodeVector functions,
const NodeVector terminals,
int  max_d,
const vector< float > &  term_weights,
const vector< float > &  op_weights,
char  otype,
const vector< char > &  term_types 
)

recursively builds a program with complete arguments.

Definition at line 243 of file nodevector.cc.

◆ operator=() [1/2]

NodeVector & FT::Pop::NodeVector::operator= ( NodeVector &&  other)
default

◆ operator=() [2/2]

NodeVector & FT::Pop::NodeVector::operator= ( NodeVector const &  other)

Definition at line 28 of file nodevector.cc.

◆ roots()

vector< size_t > FT::Pop::NodeVector::roots ( ) const

returns indices of root nodes

Definition at line 55 of file nodevector.cc.

◆ set_weights()

void FT::Pop::NodeVector::set_weights ( vector< vector< float >> &  weights)

Definition at line 150 of file nodevector.cc.

◆ subtree()

size_t FT::Pop::NodeVector::subtree ( size_t  i,
char  otype = '0',
string  indent = "> " 
) const

finds index of the end of subtree in program with root i.

Input:

i, root index of subtree

Output:

last index in subtree, <= i

note that this function assumes a subtree's arguments to be contiguous in the program.

Definition at line 80 of file nodevector.cc.


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