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.
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
Definition: Node.h:37
virtual bool saveParametersToFile(std::fstream &file) const
virtual bool loadParametersFromFile(std::fstream &file)
virtual bool predict(const VectorFloat &x)
DecisionTreeClusterNode * deepCopy() const
virtual bool computeLeafNodeWeights(MatrixFloat &weights) const
virtual bool computeFeatureWeights(VectorFloat &weights) const
virtual Node * deepCopyNode() const
This file implements a DecisionTreeNode, which is a specific base node used for a DecisionTree...
virtual bool getModel(std::ostream &stream) const
bool set(const UINT nodeSize, const UINT featureIndex, const Float threshold, const VectorFloat &classProbabilities)