GestureRecognitionToolkit  Version: 0.2.5
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 GRT_API Tree : public MLBase
39 {
40 public:
41  enum TrainingMode{BEST_ITERATIVE_SPILT=0,BEST_RANDOM_SPLIT,NUM_TRAINING_MODES};
42 
52  Tree(const UINT numSplittingSteps=100,const UINT minNumSamplesPerNode=5,const UINT maxDepth=10,const bool removeFeaturesAtEachSpilt = false,const TrainingMode trainingMode = BEST_ITERATIVE_SPILT);
53 
57  virtual ~Tree(void);
58 
65  virtual bool clear() override;
66 
72  virtual bool print() const override;
73 
81  virtual bool getModel( std::ostream &stream ) const override;
82 
90  virtual Node* deepCopyTree() const;
91 
97  const Node* getTree() const;
98 
104  UINT getTrainingMode() const;
105 
114  UINT getNumSplittingSteps() const;
115 
122  UINT getMinNumSamplesPerNode() const;
123 
129  UINT getMaxDepth() const;
130 
136  UINT getPredictedNodeID() const;
137 
143  bool getRemoveFeaturesAtEachSpilt() const;
144 
151  bool setTrainingMode(const TrainingMode trainingMode);
152 
165  bool setNumSplittingSteps(const UINT numSplittingSteps);
166 
175  bool setMinNumSamplesPerNode(const UINT minNumSamplesPerNode);
176 
184  bool setMaxDepth(const UINT maxDepth);
185 
194  bool setRemoveFeaturesAtEachSpilt(const bool removeFeaturesAtEachSpilt);
195 
196 protected:
197 
198  TrainingMode trainingMode;
199  UINT numSplittingSteps;
200  UINT minNumSamplesPerNode;
201  UINT maxDepth;
202  bool removeFeaturesAtEachSpilt;
203  Node *tree;
204 };
205 
206 GRT_END_NAMESPACE
207 
208 #endif //GRT_TREE_HEADER
Definition: Node.h:37
virtual bool getModel(std::ostream &stream) const
Definition: MLBase.cpp:213
Definition: Tree.h:38
virtual bool print() const
Definition: MLBase.cpp:165
This class contains the main Node base class.
virtual bool clear()
Definition: MLBase.cpp:149
This is the main base class that all GRT machine learning algorithms should inherit from...
Definition: MLBase.h:72