![]() |
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.
|
Public Member Functions | |
DecisionStump (const UINT numRandomSplits=100) | |
virtual | ~DecisionStump () |
DecisionStump (const DecisionStump &rhs) | |
DecisionStump & | operator= (const DecisionStump &rhs) |
virtual bool | deepCopyFrom (const WeakClassifier *weakClassifer) |
virtual bool | train (ClassificationData &trainingData, VectorDouble &weights) |
virtual double | predict (const VectorDouble &x) |
virtual bool | saveModelToFile (fstream &file) const |
virtual bool | loadModelFromFile (fstream &file) |
virtual void | print () const |
UINT | getDecisionFeatureIndex () const |
UINT | getDirection () const |
UINT | getNumRandomSplits () const |
double | getDecisionValue () const |
![]() | |
WeakClassifier () | |
virtual | ~WeakClassifier () |
WeakClassifier (const WeakClassifier &rhs) | |
WeakClassifier & | operator= (const WeakClassifier &rhs) |
bool | copyBaseVariables (const WeakClassifier *weakClassifer) |
virtual double | getPositiveClassLabel () const |
virtual double | getNegativeClassLabel () const |
string | getWeakClassifierType () const |
bool | getTrained () const |
UINT | getNumInputDimensions () const |
WeakClassifier * | createNewInstance () const |
Protected Attributes | |
UINT | decisionFeatureIndex |
The dimension that the data will be spilt on. | |
UINT | direction |
Indicates if the decision spilt threshold is greater than (1), or less than (0) | |
UINT | numRandomSplits |
The number of random splits used to search for the best decision spilt. | |
double | decisionValue |
The decision spilt threshold. | |
![]() | |
string | weakClassifierType |
A string that represents the weak classifier type, e.g. DecisionStump. | |
bool | trained |
A flag to show if the weak classifier model has been trained. | |
UINT | numInputDimensions |
The number of input dimensions to the weak classifier. | |
TrainingLog | trainingLog |
ErrorLog | errorLog |
WarningLog | warningLog |
Static Protected Attributes | |
static RegisterWeakClassifierModule< DecisionStump > | registerModule |
This is used to register the DecisionStump with the WeakClassifier base class. | |
Additional Inherited Members | |
![]() | |
typedef std::map< string, WeakClassifier *(*)() > | StringWeakClassifierMap |
![]() | |
static WeakClassifier * | createInstanceFromString (string const &weakClassifierType) |
![]() | |
static StringWeakClassifierMap * | getMap () |
Definition at line 36 of file DecisionStump.h.
DecisionStump::DecisionStump | ( | const UINT | numRandomSplits = 100 | ) |
Default Constructor.
Sets the number of random splits that will be used to search for the best split value.
const | UINT numRandomSplits: sets the number of random splits that will be used to search for the best split value. Default value = 100 |
Definition at line 35 of file DecisionStump.cpp.
|
virtual |
Default Destructor.
Definition at line 48 of file DecisionStump.cpp.
DecisionStump::DecisionStump | ( | const DecisionStump & | rhs | ) |
Default Copy Constructor. Defines how the data from the rhs GRT::DecisionStump instance is copied to this GRT::DecisionStump instance.
Definition at line 52 of file DecisionStump.cpp.
|
virtual |
This function enables the data from one GRT::DecisionStump instance to be copied into this GRT::DecisionStump instance.
WeakClassifier | *weakClassifer: a pointer to the Classifier Base Class, this should be pointing to another GRT::DecisionStump instance |
Reimplemented from GRT::WeakClassifier.
Definition at line 67 of file DecisionStump.cpp.
UINT DecisionStump::getDecisionFeatureIndex | ( | ) | const |
Definition at line 255 of file DecisionStump.cpp.
double DecisionStump::getDecisionValue | ( | ) | const |
Definition at line 267 of file DecisionStump.cpp.
UINT DecisionStump::getDirection | ( | ) | const |
Definition at line 259 of file DecisionStump.cpp.
UINT DecisionStump::getNumRandomSplits | ( | ) | const |
Definition at line 263 of file DecisionStump.cpp.
|
virtual |
This function loads an model model from a file.
fstream &file: a reference to the file you want to load the RBF model from
Reimplemented from GRT::WeakClassifier.
Definition at line 180 of file DecisionStump.cpp.
DecisionStump & DecisionStump::operator= | ( | const DecisionStump & | rhs | ) |
Defines how the data from the rhs GRT::DecisionStump instance is copied to this GRT::DecisionStump instance.
Definition at line 56 of file DecisionStump.cpp.
|
virtual |
This function predicts the class label of the input vector, given the current model. The class label returned will either be positive (WEAK_CLASSIFIER_POSITIVE_CLASS_LABEL) or negative (WEAK_CLASSIFIER_NEGATIVE_CLASS_LABEL).
VectorDouble | &weights: a reference to the vector used for prediction |
Reimplemented from GRT::WeakClassifier.
Definition at line 150 of file DecisionStump.cpp.
|
virtual |
This function prints out some basic info about the model to std::cout.
Reimplemented from GRT::WeakClassifier.
Definition at line 248 of file DecisionStump.cpp.
|
virtual |
This function saves the current model to a file.
fstream &file: a reference to the file you want to save the RBF model to
Reimplemented from GRT::WeakClassifier.
Definition at line 157 of file DecisionStump.cpp.
|
virtual |
This function trains the DecisionStump model, using the weighted labelled training data.
ClassificationData | &trainingData: the labelled training data |
VectorDouble | &weights: the corresponding weights for each sample in the labelled training data |
Reimplemented from GRT::WeakClassifier.
Definition at line 77 of file DecisionStump.cpp.