GestureRecognitionToolkit  Version: 0.2.0
The Gesture Recognition Toolkit (GRT) is a cross-platform, open-source, c++ machine learning library for real-time gesture recognition.
DecisionTreeClusterNode.h
Go to the documentation of this file.
1 
35 #ifndef GRT_DECISION_TREE_CLUSTER_NODE_HEADER
36 #define GRT_DECISION_TREE_CLUSTER_NODE_HEADER
37 
38 #include "DecisionTreeNode.h"
39 #include "../../ClusteringModules/KMeans/KMeans.h"
40 
41 GRT_BEGIN_NAMESPACE
42 
44 public:
49 
53  virtual ~DecisionTreeClusterNode();
54 
65  virtual bool predict(const VectorFloat &x);
66 
73  virtual bool clear();
74 
81  virtual bool print() const;
82 
89  virtual bool computeFeatureWeights( VectorFloat &weights ) const;
90 
97  virtual bool computeLeafNodeWeights( MatrixFloat &weights ) const;
98 
106  virtual bool getModel( std::ostream &stream ) const;
107 
114  virtual Node* deepCopyNode() const;
115 
123 
129  UINT getFeatureIndex() const;
130 
136  Float getThreshold() const;
137 
147  bool set(const UINT nodeSize,const UINT featureIndex,const Float threshold,const VectorFloat &classProbabilities);
148 
149 protected:
150 
151  virtual bool computeBestSpiltBestIterativeSpilt( const UINT &numSplittingSteps, const ClassificationData &trainingData, const Vector< UINT > &features, const Vector< UINT > &classLabels, UINT &featureIndex, Float &minError );
152 
153  virtual bool computeBestSpiltBestRandomSpilt( const UINT &numSplittingSteps, const ClassificationData &trainingData, const Vector< UINT > &features, const Vector< UINT > &classLabels, UINT &featureIndex, Float &minError );
154 
155  bool computeBestSpilt( const UINT &numSplittingSteps, const ClassificationData &trainingData, const Vector< UINT > &features, const Vector< UINT > &classLabels, UINT &featureIndex, Float &minError );
156 
157  bool computeError( const ClassificationData &trainingData, MatrixFloat &data, const Vector< UINT > &classLabels, Vector< MinMax > ranges, Vector< UINT > groupIndex, const UINT featureIndex, Float &threshold, Float &error );
158 
166  virtual bool saveParametersToFile( std::fstream &file ) const;
167 
174  virtual bool loadParametersFromFile( std::fstream &file );
175 
176  UINT featureIndex;
177  Float threshold;
178 
179  static RegisterNode< DecisionTreeClusterNode > registerModule;
180 };
181 
182 GRT_END_NAMESPACE
183 
184 #endif //GRT_DECISION_TREE_CLUSTER_NODE_HEADER
virtual bool computeBestSpilt(const UINT &trainingMode, const UINT &numSplittingSteps, const ClassificationData &trainingData, const Vector< UINT > &features, const Vector< UINT > &classLabels, UINT &featureIndex, Float &minError)
virtual bool clear()
Definition: Node.h:37
virtual bool print() const
Definition: Node.cpp:109
This file implements a DecisionTreeNode, which is a specific base node used for a DecisionTree...
virtual bool computeFeatureWeights(VectorFloat &weights) const
Definition: Node.cpp:101
virtual bool saveParametersToFile(std::fstream &file) const
virtual bool predict(const VectorFloat &x, VectorFloat &classLikelihoods)
DecisionTreeNode * deepCopy() const
virtual Node * deepCopyNode() const
virtual bool computeLeafNodeWeights(MatrixFloat &weights) const
Definition: Node.cpp:105
virtual bool loadParametersFromFile(std::fstream &file)
virtual bool getModel(std::ostream &stream) const