GestureRecognitionToolkit  Version: 1.0 Revision: 04-03-15
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 namespace GRT{
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, VectorDouble &weights);
78 
86  virtual double predict(const VectorDouble &x);
87 
94  virtual bool saveModelToFile(fstream &file) const;
95 
102  virtual bool loadModelFromFile(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  double getDecisionValue() const;
128 protected:
130  UINT direction;
132  double decisionValue;
133 
135 };
136 
137 } //End of namespace GRT
138 
139 #endif //GRT_DECISION_STUMP_HEADER
UINT numRandomSplits
The number of random splits used to search for the best decision spilt.
UINT getNumRandomSplits() const
DecisionStump & operator=(const DecisionStump &rhs)
virtual ~DecisionStump()
virtual void print() const
virtual bool saveModelToFile(fstream &file) const
Definition: AdaBoost.cpp:25
static RegisterWeakClassifierModule< DecisionStump > registerModule
This is used to register the DecisionStump with the WeakClassifier base class.
virtual double predict(const VectorDouble &x)
This is the main base class for all GRT WeakClassifiers.
DecisionStump(const UINT numRandomSplits=100)
UINT decisionFeatureIndex
The dimension that the data will be spilt on.
virtual bool train(ClassificationData &trainingData, VectorDouble &weights)
UINT getDirection() const
UINT getDecisionFeatureIndex() const
UINT direction
Indicates if the decision spilt threshold is greater than (1), or less than (0)
virtual bool loadModelFromFile(fstream &file)
virtual bool deepCopyFrom(const WeakClassifier *weakClassifer)
double decisionValue
The decision spilt threshold.
double getDecisionValue() const