![]() |
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 | |
LogisticRegression (const bool useScaling=true) | |
virtual | ~LogisticRegression (void) |
LogisticRegression & | operator= (const LogisticRegression &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) |
UINT | getMaxNumIterations () const |
bool | setMaxNumIterations (UINT maxNumIterations) |
![]() | |
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 | |
double | sigmoid (const double x) const |
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 | |
double | w0 |
VectorDouble | w |
![]() | |
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< LogisticRegression > | 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 40 of file LogisticRegression.h.
GRT::LogisticRegression::LogisticRegression | ( | const bool | useScaling = true | ) |
Default Constructor
const | bool useScaling: sets if the training and real-time data should be scaled between [0 1]. Default value = true |
Definition at line 30 of file LogisticRegression.cpp.
|
virtual |
Default Destructor
Definition at line 44 of file LogisticRegression.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 Logistic Regression instance) into this instance
Regressifier | *regressifier: a pointer to the Regressifier Base Class, this should be pointing to another Logistic Regression instance |
Reimplemented from GRT::Regressifier.
Definition at line 59 of file LogisticRegression.cpp.
UINT GRT::LogisticRegression::getMaxNumIterations | ( | ) | const |
Gets the current maxNumIterations value, this is the maximum number of iterations that can be run during the training phase.
Definition at line 318 of file LogisticRegression.cpp.
|
protected |
Read the ranges if needed
Definition at line 330 of file LogisticRegression.cpp.
|
virtual |
This loads a trained Logistic Regression model from a file. This overrides the loadModelFromFile function in the Logistic Regression base class.
fstream | &file: a reference to the file the Logistic Regression model will be loaded from |
Reimplemented from GRT::MLBase.
Definition at line 262 of file LogisticRegression.cpp.
LogisticRegression & GRT::LogisticRegression::operator= | ( | const LogisticRegression & | rhs | ) |
Defines how the data from the rhs LogisticRegression should be copied to this LogisticRegression
const | LRC &rhs: another instance of a LogisticRegression |
Definition at line 48 of file LogisticRegression.cpp.
|
virtual |
This performs the regression by mapping the inputVector using the current Logistic Regression model. This overrides the predict function in the Regressifier base class.
VectorDouble | &inputVector: the input vector to classify |
Reimplemented from GRT::MLBase.
Definition at line 198 of file LogisticRegression.cpp.
|
virtual |
This saves the trained Logistic Regression model to a file. This overrides the saveModelToFile function in the ML base class.
fstream | &file: a reference to the file the Logistic Regression model will be saved to |
Reimplemented from GRT::MLBase.
Definition at line 233 of file LogisticRegression.cpp.
bool GRT::LogisticRegression::setMaxNumIterations | ( | UINT | maxNumIterations | ) |
Sets the maximum number of iterations that can be run during the training phase. The maxNumIterations value must be greater than zero.
UINT | maxNumIterations: the maximum number of iterations value, must be greater than zero |
Definition at line 322 of file LogisticRegression.cpp.
|
virtual |
This trains the Logistic Regression model, using the labelled regression data. This overrides the train function in the Regression base class.
RegressionData | &trainingData: the training data that will be used to train the regression model |
Reimplemented from GRT::MLBase.
Definition at line 75 of file LogisticRegression.cpp.