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.
TrainingResult.h
Go to the documentation of this file.
1 
9 #ifndef GRT_TRAINING_RESULT_HEADER
10 #define GRT_TRAINING_RESULT_HEADER
11 
12 namespace GRT {
13 
14 //Forward declartion of MLBase class
15 class MLBase;
16 
18 public:
25  trainingMode = CLASSIFICATION_MODE;
26  trainingIteration = 0;
27  accuracy = 0;
28  totalSquaredTrainingError = 0;
29  rootMeanSquaredTrainingError = 0;
30  trainer = NULL;
31  }
32 
41  *this = rhs;
42  }
43 
48 
49  }
50 
59  if( this != &rhs ){
60  this->trainingMode = rhs.trainingMode;
61  this->trainingIteration = rhs.trainingIteration;
62  this->accuracy = rhs.accuracy;
63  this->totalSquaredTrainingError = rhs.totalSquaredTrainingError;
64  this->rootMeanSquaredTrainingError = rhs.rootMeanSquaredTrainingError;
65  this->trainer = rhs.trainer;
66  }
67  return *this;
68  }
69 
75  unsigned int getTrainingMode() const{
76  return trainingMode;
77  }
78 
84  unsigned int getTrainingIteration() const{
85  return trainingIteration;
86  }
87 
94  double getAccuracy() const{
95  return accuracy;
96  }
97 
105  return totalSquaredTrainingError;
106  }
107 
115  return rootMeanSquaredTrainingError;
116  }
117 
123  MLBase* getTrainer() const{
124  return trainer;
125  }
126 
135  bool setClassificationResult(unsigned int trainingIteration,double accuracy,MLBase *trainer){
136  this->trainingMode = CLASSIFICATION_MODE;
137  this->trainingIteration = trainingIteration;
138  this->accuracy = accuracy;
139  this->trainer = trainer;
140  return true;
141  }
142 
152  bool setRegressionResult(unsigned int trainingIteration,double totalSquaredTrainingError,double rootMeanSquaredTrainingError,MLBase *trainer){
153  this->trainingMode = REGRESSION_MODE;
154  this->trainingIteration = trainingIteration;
155  this->totalSquaredTrainingError = totalSquaredTrainingError;
156  this->rootMeanSquaredTrainingError = rootMeanSquaredTrainingError;
157  this->trainer = trainer;
158  return true;
159  }
160 
161 protected:
162 
163  unsigned int trainingMode;
164  unsigned int trainingIteration;
165  double accuracy;
166  double totalSquaredTrainingError;
167  double rootMeanSquaredTrainingError;
168  MLBase *trainer;
169 
170 public:
171 
172  enum TrainingMode{CLASSIFICATION_MODE=0,REGRESSION_MODE};
173 
174 };
175 
176 }//End of namespace GRT
177 
178 #endif //GRT_TRAINING_RESULT_HEADER
bool setRegressionResult(unsigned int trainingIteration, double totalSquaredTrainingError, double rootMeanSquaredTrainingError, MLBase *trainer)
double getTotalSquaredTrainingError() const
double getAccuracy() const
TrainingResult & operator=(const TrainingResult &rhs)
Definition: AdaBoost.cpp:25
unsigned int getTrainingIteration() const
MLBase * getTrainer() const
double getRootMeanSquaredTrainingError() const
bool setClassificationResult(unsigned int trainingIteration, double accuracy, MLBase *trainer)
unsigned int getTrainingMode() const
TrainingResult(const TrainingResult &rhs)