GestureRecognitionToolkit  Version: 0.2.0
The Gesture Recognition Toolkit (GRT) is a cross-platform, open-source, c++ machine learning library for real-time gesture recognition.
ClassificationResult.h
Go to the documentation of this file.
1 
9 /*
10  GRT MIT License
11  Copyright (c) <2012> <Nicholas Gillian, Media Lab, MIT>
12 
13  Permission is hereby granted, free of charge, to any person obtaining a copy of this software
14  and associated documentation files (the "Software"), to deal in the Software without restriction,
15  including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
16  and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
17  subject to the following conditions:
18 
19  The above copyright notice and this permission notice shall be included in all copies or substantial
20  portions of the Software.
21 
22  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
23  LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
24  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
25  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26  SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27  */
28 
29 #ifndef GRT_CLASSIFICATION_RESULT_HEADER
30 #define GRT_CLASSIFICATION_RESULT_HEADER
31 #include "GRTCommon.h"
32 
33 GRT_BEGIN_NAMESPACE
34 
36 public:
49  ClassificationResult(UINT classLabel=0,UINT predictedClassLabel=0,UINT unprocessedPredictedClassLabel=0,Float maximumLikelihood=0,VectorFloat classLikelihoods=VectorDouble(),VectorFloat classDistances = VectorFloat()){
50  this->classLabel = classLabel;
51  this->predictedClassLabel = predictedClassLabel;
52  this->unprocessedPredictedClassLabel = unprocessedPredictedClassLabel;
53  this->maximumLikelihood = maximumLikelihood;
54  this->classLikelihoods = classLikelihoods;
55  this->classDistances = classDistances;
56  }
57 
66  this->classLabel = rhs.classLabel;
67  this->predictedClassLabel = rhs.predictedClassLabel;
68  this->unprocessedPredictedClassLabel = rhs.unprocessedPredictedClassLabel;
69  this->maximumLikelihood = rhs.maximumLikelihood;
70  this->classLikelihoods = rhs.classLikelihoods;
71  this->classDistances = rhs.classDistances;
72  }
73 
78 
79  }
80 
88  if( this != &rhs ){
89  this->classLabel = rhs.classLabel;
90  this->predictedClassLabel = rhs.predictedClassLabel;
91  this->unprocessedPredictedClassLabel = rhs.unprocessedPredictedClassLabel;
92  this->maximumLikelihood = rhs.maximumLikelihood;
93  this->classLikelihoods = rhs.classLikelihoods;
94  this->classDistances = rhs.classDistances;
95  }
96  return *this;
97  }
98 
104  bool getCorrectPrediction() const {
105  return( classLabel == predictedClassLabel);
106  }
107 
113  UINT getClassLabel() const {
114  return classLabel;
115  }
116 
123  UINT getPredictedClassLabel() const {
124  return predictedClassLabel;
125  }
126 
134  return unprocessedPredictedClassLabel;
135  }
136 
142  Float getMaximumLikelihood() const {
143  return maximumLikelihood;
144  }
145 
152  return classLikelihoods;
153  }
154 
161  return classDistances;
162  }
163 
164  UINT classLabel;
165  UINT predictedClassLabel;
166  UINT unprocessedPredictedClassLabel;
167  Float maximumLikelihood;
168  VectorFloat classLikelihoods;
169  VectorFloat classDistances;
170 };
171 
172 GRT_END_NAMESPACE
173 
174 #endif //GRT_CLASSIFICATION_RESULT_HEADER
ClassificationResult(UINT classLabel=0, UINT predictedClassLabel=0, UINT unprocessedPredictedClassLabel=0, Float maximumLikelihood=0, VectorFloat classLikelihoods=VectorDouble(), VectorFloat classDistances=VectorFloat())
VectorFloat getClassDistances() const
Float getMaximumLikelihood() const
ClassificationResult(const ClassificationResult &rhs)
UINT getPredictedClassLabel() const
bool getCorrectPrediction() const
UINT getUnprocessedPredictedClassLabel() const
ClassificationResult operator=(const ClassificationResult &rhs)
VectorFloat getClassLikelihoods() const