![]() |
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 | |
MultidimensionalRegression (const Regressifier ®ressifier=LinearRegression(), bool useScaling=false) | |
virtual | ~MultidimensionalRegression (void) |
MultidimensionalRegression & | operator= (const MultidimensionalRegression &rhs) |
virtual bool | deepCopyFrom (const Regressifier *regressifier) |
virtual bool | train_ (RegressionData &trainingData) |
virtual bool | predict_ (VectorDouble &inputVector) |
virtual bool | saveModelToFile (fstream &file) const |
virtual bool | loadModelFromFile (fstream &file) |
bool | getIsRegressionModuleSet () const |
Regressifier * | getRegressifier () const |
bool | setRegressionModule (const Regressifier ®ressifier) |
![]() | |
Regressifier (void) | |
virtual | ~Regressifier (void) |
bool | copyBaseVariables (const Regressifier *regressifier) |
virtual bool | reset () |
virtual bool | clear () |
string | getRegressifierType () const |
VectorDouble | getRegressionData () const |
vector< MinMax > | getInputRanges () const |
vector< MinMax > | getOutputRanges () const |
Regressifier * | createNewInstance () const |
Regressifier * | deepCopy () const |
const Regressifier & | getBaseRegressifier () const |
![]() | |
MLBase (void) | |
virtual | ~MLBase (void) |
bool | copyMLBaseVariables (const MLBase *mlBase) |
virtual bool | train (ClassificationData trainingData) |
virtual bool | train_ (ClassificationData &trainingData) |
virtual bool | train (RegressionData trainingData) |
virtual bool | train (TimeSeriesClassificationData trainingData) |
virtual bool | train_ (TimeSeriesClassificationData &trainingData) |
virtual bool | train (TimeSeriesClassificationDataStream trainingData) |
virtual bool | train_ (TimeSeriesClassificationDataStream &trainingData) |
virtual bool | train (UnlabelledData trainingData) |
virtual bool | train_ (UnlabelledData &trainingData) |
virtual bool | train (MatrixDouble data) |
virtual bool | train_ (MatrixDouble &data) |
virtual bool | predict (VectorDouble inputVector) |
virtual bool | predict (MatrixDouble inputMatrix) |
virtual bool | predict_ (MatrixDouble &inputMatrix) |
virtual bool | map (VectorDouble inputVector) |
virtual bool | map_ (VectorDouble &inputVector) |
virtual bool | print () const |
virtual bool | save (const string filename) const |
virtual bool | load (const string filename) |
virtual bool | saveModelToFile (string filename) const |
virtual bool | loadModelFromFile (string filename) |
virtual bool | getModel (ostream &stream) const |
double | scale (const double &x, const double &minSource, const double &maxSource, const double &minTarget, const double &maxTarget, const bool constrain=false) |
virtual string | getModelAsString () const |
UINT | getBaseType () const |
UINT | getNumInputFeatures () const |
UINT | getNumInputDimensions () const |
UINT | getNumOutputDimensions () const |
UINT | getMinNumEpochs () const |
UINT | getMaxNumEpochs () const |
UINT | getValidationSetSize () const |
UINT | getNumTrainingIterationsToConverge () const |
double | getMinChange () const |
double | getLearningRate () const |
double | getRootMeanSquaredTrainingError () const |
double | getTotalSquaredTrainingError () const |
bool | getUseValidationSet () const |
bool | getRandomiseTrainingOrder () const |
bool | getTrained () const |
bool | getModelTrained () const |
bool | getScalingEnabled () const |
bool | getIsBaseTypeClassifier () const |
bool | getIsBaseTypeRegressifier () const |
bool | getIsBaseTypeClusterer () const |
bool | enableScaling (bool useScaling) |
bool | setMaxNumEpochs (const UINT maxNumEpochs) |
bool | setMinNumEpochs (const UINT minNumEpochs) |
bool | setMinChange (const double minChange) |
bool | setLearningRate (double learningRate) |
bool | setUseValidationSet (const bool useValidationSet) |
bool | setValidationSetSize (const UINT validationSetSize) |
bool | setRandomiseTrainingOrder (const bool randomiseTrainingOrder) |
bool | registerTrainingResultsObserver (Observer< TrainingResult > &observer) |
bool | registerTestResultsObserver (Observer< TestInstanceResult > &observer) |
bool | removeTrainingResultsObserver (const Observer< TrainingResult > &observer) |
bool | removeTestResultsObserver (const Observer< TestInstanceResult > &observer) |
bool | removeAllTrainingObservers () |
bool | removeAllTestObservers () |
bool | notifyTrainingResultsObservers (const TrainingResult &data) |
bool | notifyTestResultsObservers (const TestInstanceResult &data) |
MLBase * | getMLBasePointer () |
const MLBase * | getMLBasePointer () const |
vector< TrainingResult > | getTrainingResults () const |
![]() | |
GRTBase (void) | |
virtual | ~GRTBase (void) |
bool | copyGRTBaseVariables (const GRTBase *GRTBase) |
string | getClassType () const |
string | getLastWarningMessage () const |
string | getLastErrorMessage () const |
string | getLastInfoMessage () const |
GRTBase * | getGRTBasePointer () |
const GRTBase * | getGRTBasePointer () const |
![]() | |
virtual void | notify (const TrainingResult &data) |
![]() | |
virtual void | notify (const TestInstanceResult &data) |
Protected Member Functions | |
bool | deepCopyRegressionModules (vector< Regressifier * > &newModules) const |
bool | deleteAll () |
bool | deleteRegressionModules () |
bool | loadLegacyModelFromFile (fstream &file) |
![]() | |
bool | saveBaseSettingsToFile (fstream &file) const |
bool | loadBaseSettingsFromFile (fstream &file) |
![]() | |
bool | saveBaseSettingsToFile (fstream &file) const |
bool | loadBaseSettingsFromFile (fstream &file) |
![]() | |
double | SQR (const double &x) const |
Protected Attributes | |
Regressifier * | regressifier |
vector< Regressifier * > | regressionModules |
![]() | |
string | regressifierType |
VectorDouble | regressionData |
vector< MinMax > | inputVectorRanges |
vector< MinMax > | targetVectorRanges |
![]() | |
bool | trained |
bool | useScaling |
UINT | baseType |
UINT | numInputDimensions |
UINT | numOutputDimensions |
UINT | numTrainingIterationsToConverge |
UINT | minNumEpochs |
UINT | maxNumEpochs |
UINT | validationSetSize |
double | learningRate |
double | minChange |
double | rootMeanSquaredTrainingError |
double | totalSquaredTrainingError |
bool | useValidationSet |
bool | randomiseTrainingOrder |
Random | random |
vector< TrainingResult > | trainingResults |
TrainingResultsObserverManager | trainingResultsObserverManager |
TestResultsObserverManager | testResultsObserverManager |
![]() | |
string | classType |
DebugLog | debugLog |
ErrorLog | errorLog |
InfoLog | infoLog |
TrainingLog | trainingLog |
TestingLog | testingLog |
WarningLog | warningLog |
Static Protected Attributes | |
static RegisterRegressifierModule< MultidimensionalRegression > | registerModule |
Additional Inherited Members | |
![]() | |
typedef std::map< string, Regressifier *(*)() > | StringRegressifierMap |
![]() | |
enum | BaseTypes { BASE_TYPE_NOT_SET =0, CLASSIFIER, REGRESSIFIER, CLUSTERER } |
![]() | |
static Regressifier * | createInstanceFromString (string const ®ressifierType) |
static vector< string > | getRegisteredRegressifiers () |
![]() | |
static string | getGRTVersion (bool returnRevision=true) |
static string | getGRTRevison () |
![]() | |
static StringRegressifierMap * | getMap () |
Definition at line 47 of file MultidimensionalRegression.h.
GRT::MultidimensionalRegression::MultidimensionalRegression | ( | const Regressifier & | regressifier = LinearRegression() , |
bool | useScaling = false |
||
) |
Default Constructor
bool | useScaling: sets if the training and real-time data should be scaled between [0 1]. Default value = false |
Definition at line 28 of file MultidimensionalRegression.cpp.
|
virtual |
Default Destructor
Definition at line 41 of file MultidimensionalRegression.cpp.
|
virtual |
This is required for the Gesture Recognition Pipeline for when the pipeline.setRegressifier(...) method is called. It clones the data from the Base Class Regressifier pointer (which should be pointing to an Multidimensional Regressioninstance) into this instance
Regressifier | *regressifier: a pointer to the Regressifier Base Class, this should be pointing to another Multidimensional Regression instance |
Reimplemented from GRT::Regressifier.
Definition at line 67 of file MultidimensionalRegression.cpp.
bool GRT::MultidimensionalRegression::getIsRegressionModuleSet | ( | ) | const |
This returns true if the regression module has been set. The regression module is the regression algorithm that will be used when the user attempts to train N regression models.
A regression module must be set before a regression model can be trained.
Definition at line 320 of file MultidimensionalRegression.cpp.
Regressifier * GRT::MultidimensionalRegression::getRegressifier | ( | ) | const |
This returns a pointer to the regression module. If no regression module has been set, then this function will return NULL.
Definition at line 324 of file MultidimensionalRegression.cpp.
|
protected |
Read the ranges if needed
Definition at line 396 of file MultidimensionalRegression.cpp.
|
virtual |
This loads a trained Multidimensional Regression model from a file. This overrides the loadModelFromFile function in the ML base class.
fstream | &file: a reference to the file the Logistic Regression model will be loaded from |
Reimplemented from GRT::MLBase.
Definition at line 245 of file MultidimensionalRegression.cpp.
MultidimensionalRegression & GRT::MultidimensionalRegression::operator= | ( | const MultidimensionalRegression & | rhs | ) |
Defines how the data from the rhs MultidimensionalRegression should be copied to this MultidimensionalRegression
const | LRC &rhs: another instance of a MultidimensionalRegression |
Definition at line 46 of file MultidimensionalRegression.cpp.
|
virtual |
This performs the regression by mapping the inputVector using the current Multidimensional Regression model. This overrides the predict function in the ML base class.
VectorDouble | &inputVector: the input vector to classify |
Reimplemented from GRT::MLBase.
Definition at line 169 of file MultidimensionalRegression.cpp.
|
virtual |
This saves the trained Multidimensional Regression model to a file. This overrides the saveModelToFile function in the ML base class.
fstream | &file: a reference to the file the Multidimensional Regression model will be saved to |
Reimplemented from GRT::MLBase.
Definition at line 205 of file MultidimensionalRegression.cpp.
bool GRT::MultidimensionalRegression::setRegressionModule | ( | const Regressifier & | regressifier | ) |
Sets the regression module that will be used the next time a user attempts to train a regression module.
const | Regressifier ®ressifier: a reference to a regression module that will be copied and used the next time the user attempts to train a regression module |
Definition at line 328 of file MultidimensionalRegression.cpp.
|
virtual |
This trains the Multidimensional Regression model, using the labelled regression data. This overrides the train function in the ML base class.
RegressionData | &trainingData: the training data that will be used to train the regression model |
Reimplemented from GRT::MLBase.
Definition at line 91 of file MultidimensionalRegression.cpp.