GestureRecognitionToolkit  Version: 0.1.0
The Gesture Recognition Toolkit (GRT) is a cross-platform, open-source, c++ machine learning library for real-time gesture recognition.
Tree.h
Go to the documentation of this file.
1 
31 #ifndef GRT_TREE_HEADER
32 #define GRT_TREE_HEADER
33 
34 #include "Node.h"
35 
36 GRT_BEGIN_NAMESPACE
37 
38 class Tree : public GRTBase
39 {
40 public:
50  Tree(const UINT numSplittingSteps=100,const UINT minNumSamplesPerNode=5,const UINT maxDepth=10,const bool removeFeaturesAtEachSpilt = false,const UINT trainingMode = BEST_ITERATIVE_SPILT);
51 
55  virtual ~Tree(void);
56 
63  virtual bool clear();
64 
70  virtual bool print() const;
71 
79  virtual bool getModel( std::ostream &stream ) const;
80 
88  virtual Node* deepCopyTree() const;
89 
95  const Node* getTree() const;
96 
102  UINT getTrainingMode() const;
103 
112  UINT getNumSplittingSteps() const;
113 
120  UINT getMinNumSamplesPerNode() const;
121 
127  UINT getMaxDepth() const;
128 
134  UINT getPredictedNodeID() const;
135 
141  bool getRemoveFeaturesAtEachSpilt() const;
142 
149  bool setTrainingMode(const UINT trainingMode);
150 
163  bool setNumSplittingSteps(const UINT numSplittingSteps);
164 
173  bool setMinNumSamplesPerNode(const UINT minNumSamplesPerNode);
174 
182  bool setMaxDepth(const UINT maxDepth);
183 
192  bool setRemoveFeaturesAtEachSpilt(const bool removeFeaturesAtEachSpilt);
193 
194 protected:
195 
196  UINT trainingMode;
197  UINT numSplittingSteps;
198  UINT minNumSamplesPerNode;
199  UINT maxDepth;
200  bool removeFeaturesAtEachSpilt;
201  Node *tree;
202 
203 public:
204  enum TrainingMode{BEST_ITERATIVE_SPILT=0,BEST_RANDOM_SPLIT,NUM_TRAINING_MODES};
205 
206 };
207 
208 GRT_END_NAMESPACE
209 
210 #endif //GRT_TREE_HEADER
211 
bool setRemoveFeaturesAtEachSpilt(const bool removeFeaturesAtEachSpilt)
Definition: Tree.cpp:156
virtual bool getModel(std::ostream &stream) const
Definition: Tree.cpp:67
Definition: Node.h:37
bool setMinNumSamplesPerNode(const UINT minNumSamplesPerNode)
Definition: Tree.cpp:138
virtual bool print() const
Definition: Tree.cpp:56
UINT getNumSplittingSteps() const
Definition: Tree.cpp:95
bool setNumSplittingSteps(const UINT numSplittingSteps)
Definition: Tree.cpp:129
Definition: Tree.h:38
bool getRemoveFeaturesAtEachSpilt() const
Definition: Tree.cpp:116
UINT getTrainingMode() const
Definition: Tree.cpp:91
virtual ~Tree(void)
Definition: Tree.cpp:40
virtual bool clear()
Definition: Tree.cpp:45
This class contains the main Node base class.
const Node * getTree() const
Definition: Tree.cpp:87
bool setMaxDepth(const UINT maxDepth)
Definition: Tree.cpp:147
Tree(const UINT numSplittingSteps=100, const UINT minNumSamplesPerNode=5, const UINT maxDepth=10, const bool removeFeaturesAtEachSpilt=false, const UINT trainingMode=BEST_ITERATIVE_SPILT)
Definition: Tree.cpp:25
UINT getMaxDepth() const
Definition: Tree.cpp:103
virtual Node * deepCopyTree() const
Definition: Tree.cpp:78
UINT getMinNumSamplesPerNode() const
Definition: Tree.cpp:99
bool setTrainingMode(const UINT trainingMode)
Definition: Tree.cpp:120
UINT getPredictedNodeID() const
Definition: Tree.cpp:107