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.
DecisionTreeThresholdNode.h
Go to the documentation of this file.
1 
27 #ifndef GRT_DECISION_TREE_THRESHOLD_NODE_HEADER
28 #define GRT_DECISION_TREE_THRESHOLD_NODE_HEADER
29 
30 #include "DecisionTreeNode.h"
31 
32 GRT_BEGIN_NAMESPACE
33 
44 public:
50 
54  virtual ~DecisionTreeThresholdNode();
55 
66  virtual bool predict_(VectorFloat &x) override;
67 
74  virtual bool clear() override;
75 
82  virtual bool print() const override;
83 
91  virtual bool getModel( std::ostream &stream ) const override;
92 
99  virtual Node* deepCopy() const override;
100 
106  UINT getFeatureIndex() const;
112  Float getThreshold() const;
113 
123  bool set(const UINT nodeSize,const UINT featureIndex,const Float threshold,const VectorFloat &classProbabilities);
124 
126 
127 protected:
128 
129  virtual bool computeBestSplitBestIterativeSplit( const UINT &numSplittingSteps, const ClassificationData &trainingData, const Vector< UINT > &features, const Vector< UINT > &classLabels, UINT &featureIndex, Float &minError ) override;
130 
131  virtual bool computeBestSplitBestRandomSplit( const UINT &numSplittingSteps, const ClassificationData &trainingData, const Vector< UINT > &features, const Vector< UINT > &classLabels, UINT &featureIndex, Float &minError ) override;
132 
140  virtual bool saveParametersToFile( std::fstream &file ) const override;
141 
148  virtual bool loadParametersFromFile( std::fstream &file ) override;
149 
150  UINT featureIndex;
151  Float threshold;
152 
153  static RegisterNode< DecisionTreeThresholdNode > registerModule;
154 };
155 
156 GRT_END_NAMESPACE
157 
158 #endif //GRT_DECISION_TREE_THRESHOLD_NODE_HEADER
159 
virtual bool clear() override
Definition: Node.h:37
virtual bool predict_(VectorFloat &x, VectorFloat &classLikelihoods) override
virtual bool loadParametersFromFile(std::fstream &file) override
virtual Node * deepCopy() const override
virtual bool saveParametersToFile(std::fstream &file) const override
virtual bool getModel(std::ostream &stream) const override
virtual bool print() const override
Definition: Node.cpp:105