Feat C++ API
A feature engineering automation tool
FT::Pop::Op::Node Class Referenceabstract

Represents nodes in a program. More...

#include <node.h>

Inheritance diagram for FT::Pop::Op::Node:
Collaboration diagram for FT::Pop::Op::Node:

Public Member Functions

 Node ()
 
virtual ~Node ()
 
virtual void evaluate (const Data &data, State &state)=0
 Evaluates the node and updates the state states. More...
 
virtual void eval_eqn (State &state)=0
 evaluates the node symbolically More...
 
unsigned int total_arity ()
 
ArrayXf limited (ArrayXf x)
 limits node output to be between MIN_FLT and MAX_FLT More...
 
void eval_complexity (map< char, vector< unsigned int >> &cstate)
 evaluates complexity of this node in the context of its child nodes. More...
 
void eval_complexity_db (map< char, vector< string >> &cstate)
 evaluates complexity of this node in the context of its child nodes. More...
 
virtual bool isNodeDx ()
 check of node type More...
 
virtual bool isNodeTrain ()
 
std::unique_ptr< Nodeclone () const
 makes a unique copy of this node More...
 
std::unique_ptr< Nodernd_clone () const
 makes a randomized unique copy ofnode More...
 

Public Attributes

string name
 node type More...
 
string variable_name
 variable name, if any More...
 
char otype
 output type More...
 
std::map< char, unsigned int > arity
 arity of the operator More...
 
int complexity
 complexity of node More...
 
int visits = 0
 

Protected Member Functions

virtual Nodeclone_impl () const =0
 
virtual Nodernd_clone_impl () const =0
 

Detailed Description

Represents nodes in a program.

Definition at line 53 of file node.h.

Constructor & Destructor Documentation

◆ Node()

FT::Pop::Op::Node::Node ( )

Definition at line 11 of file node.cc.

◆ ~Node()

virtual FT::Pop::Op::Node::~Node ( )
inlinevirtual

Definition at line 65 of file node.h.

Member Function Documentation

◆ clone()

std::unique_ptr< Node > FT::Pop::Op::Node::clone ( ) const

makes a unique copy of this node

Definition at line 100 of file node.cc.

◆ clone_impl()

◆ eval_complexity()

void FT::Pop::Op::Node::eval_complexity ( map< char, vector< unsigned int >> &  cstate)

evaluates complexity of this node in the context of its child nodes.

Complexity of a node \( n \) with \( k \) arguments is defined as

\( C(n) = c_n * (\sum_{a=1}^k C(a)) \)

The complexity of a program is the complexity of its root/head node.

Definition at line 46 of file node.cc.

◆ eval_complexity_db()

void FT::Pop::Op::Node::eval_complexity_db ( map< char, vector< string >> &  cstate)

evaluates complexity of this node in the context of its child nodes.

Complexity of a node \( n \) with \( k \) arguments is defined as

\( C(n) = c_n * (\sum_{a=1}^k C(a)) \)

The complexity of a program is the complexity of its root/head node.

Definition at line 69 of file node.cc.

◆ eval_eqn()

◆ evaluate()

◆ isNodeDx()

virtual bool FT::Pop::Op::Node::isNodeDx ( )
inlinevirtual

check of node type

Reimplemented in FT::Pop::Op::NodeDx.

Definition at line 86 of file node.h.

◆ isNodeTrain()

virtual bool FT::Pop::Op::Node::isNodeTrain ( )
inlinevirtual

Reimplemented in FT::Pop::Op::NodeTrain.

Definition at line 87 of file node.h.

◆ limited()

ArrayXf FT::Pop::Op::Node::limited ( ArrayXf  x)

limits node output to be between MIN_FLT and MAX_FLT

Definition at line 37 of file node.cc.

◆ rnd_clone()

std::unique_ptr< Node > FT::Pop::Op::Node::rnd_clone ( ) const

makes a randomized unique copy ofnode

Definition at line 104 of file node.cc.

◆ rnd_clone_impl()

◆ total_arity()

unsigned int FT::Pop::Op::Node::total_arity ( )

Definition at line 19 of file node.cc.

Member Data Documentation

◆ arity

std::map<char, unsigned int> FT::Pop::Op::Node::arity

arity of the operator

Definition at line 59 of file node.h.

◆ complexity

int FT::Pop::Op::Node::complexity

complexity of node

Definition at line 60 of file node.h.

◆ name

string FT::Pop::Op::Node::name

node type

Definition at line 56 of file node.h.

◆ otype

char FT::Pop::Op::Node::otype

output type

Definition at line 58 of file node.h.

◆ variable_name

string FT::Pop::Op::Node::variable_name

variable name, if any

Definition at line 57 of file node.h.

◆ visits

int FT::Pop::Op::Node::visits = 0

Definition at line 61 of file node.h.


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