Feat C++ API
A feature engineering automation tool
nodevector.h
Go to the documentation of this file.
1 /* FEAT
2 copyright 2017 William La Cava
3 license: GNU/GPL v3
4 */
5 #ifndef NODEVECTOR_H
6 #define NODEVECTOR_H
7 #include <memory>
8 #include "nodewrapper.h"
9 #include "nodemap.h"
10 #include "../util/error.h"
11 
12 namespace FT{
13 
14  namespace Pop{
15 
16  using namespace Op;
18 
23  struct NodeVector : public std::vector<std::unique_ptr<Node>> {
24 
26 
28 
29  NodeVector(const NodeVector& other);
30 
32  /* { */
33  /* std::cout<<"in NodeVector(NodeVector&& other)\n"; */
34  /* for (const auto& p : other) */
35  /* this->push_back(p->clone()); */
36  /* } */
37 
38  NodeVector& operator=(NodeVector const& other);
39 
41 
43  vector<Node*> get_data(int start=0,int end=0);
44 
46  vector<size_t> roots() const;
47 
48  size_t subtree(size_t i, char otype='0', string indent="> ") const;
49 
50  void set_weights(vector<vector<float>>& weights);
51 
52  vector<vector<float>> get_weights();
53 
54  bool is_valid_program(unsigned num_features,
55  vector<string> longitudinalMap);
56 
57  void make_tree(const NodeVector& functions,
58  const NodeVector& terminals, int max_d,
59  const vector<float>& term_weights,
60  const vector<float>& op_weights,
61  char otype, const vector<char>& term_types);
62 
63  void make_program(const NodeVector& functions,
64  const NodeVector& terminals, int max_d,
65  const vector<float>& term_weights,
66  const vector<float>& op_weights,
67  int dim, char otype,
68  vector<string> longitudinalMap, const vector<char>& term_types);
69 
70  }; //NodeVector
71  // serializatoin
72  // forward declaration
73  void to_json(json& j, const NodeVector& nv);
74  void from_json(const json& j, NodeVector& nv);
75 
76  }
77 } // FT
78 #endif
79 
void from_json(const json &j, NodeVector &nv)
Definition: nodevector.cc:442
void to_json(json &j, const NodeVector &nv)
Definition: nodevector.cc:392
main Feat namespace
Definition: data.cc:13
int i
Definition: params.cc:552
an extension of a vector of unique pointers to nodes
Definition: nodevector.h:23
NodeVector & operator=(NodeVector &&other)
NodeVector(NodeVector &&other)