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.
DecisionStump.h
Go to the documentation of this file.
1 
29 #ifndef GRT_DECISION_STUMP_HEADER
30 #define GRT_DECISION_STUMP_HEADER
31 
32 #include "WeakClassifier.h"
33 
34 GRT_BEGIN_NAMESPACE
35 
37 public:
45  DecisionStump(const UINT numRandomSplits = 100);
46 
50  virtual ~DecisionStump();
51 
55  DecisionStump(const DecisionStump &rhs);
56 
61 
68  virtual bool deepCopyFrom(const WeakClassifier *weakClassifer);
69 
77  virtual bool train(ClassificationData &trainingData, VectorFloat &weights);
78 
86  virtual Float predict(const VectorFloat &x);
87 
94  virtual bool saveModelToFile( std::fstream &file ) const;
95 
102  virtual bool loadModelFromFile( std::fstream &file );
103 
107  virtual void print() const;
108 
112  UINT getDecisionFeatureIndex() const;
113 
117  UINT getDirection() const;
118 
122  UINT getNumRandomSplits() const;
123 
127  Float getDecisionValue() const;
128 
129 protected:
131  UINT direction;
134 
136 };
137 
138 GRT_END_NAMESPACE
139 
140 #endif //GRT_DECISION_STUMP_HEADER
UINT getNumRandomSplits() const
static RegisterWeakClassifierModule< DecisionStump > registerModule
This is used to register the DecisionStump with the WeakClassifier base class.
UINT direction
Indicates if the decision spilt threshold is greater than (1), or less than (0)
Float decisionValue
The decision spilt threshold.
DecisionStump & operator=(const DecisionStump &rhs)
virtual ~DecisionStump()
virtual bool train(ClassificationData &trainingData, VectorFloat &weights)
Float getDecisionValue() const
virtual void print() const
This is the main base class for all GRT WeakClassifiers.
DecisionStump(const UINT numRandomSplits=100)
UINT numRandomSplits
The number of random splits used to search for the best decision spilt.
virtual bool loadModelFromFile(std::fstream &file)
virtual bool saveModelToFile(std::fstream &file) const
virtual Float predict(const VectorFloat &x)
UINT getDecisionFeatureIndex() const
virtual bool deepCopyFrom(const WeakClassifier *weakClassifer)
UINT decisionFeatureIndex
The dimension that the data will be spilt on.
UINT getDirection() const