GestureRecognitionToolkit  Version: 0.1.0
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  Float 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,Float 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,Float totalSquaredTrainingError,Float 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  Float accuracy;
166  Float totalSquaredTrainingError;
167  Float 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 setClassificationResult(unsigned int trainingIteration, Float accuracy, MLBase *trainer)
TrainingResult & operator=(const TrainingResult &rhs)
Definition: DebugLog.cpp:23
unsigned int getTrainingIteration() const
Float getRootMeanSquaredTrainingError() const
Float getAccuracy() const
bool setRegressionResult(unsigned int trainingIteration, Float totalSquaredTrainingError, Float rootMeanSquaredTrainingError, MLBase *trainer)
MLBase * getTrainer() const
Float getTotalSquaredTrainingError() const
Definition: MLBase.h:70
unsigned int getTrainingMode() const
TrainingResult(const TrainingResult &rhs)