29 #ifndef GRT_TEST_INSTANCE_RESULT_HEADER
30 #define GRT_TEST_INSTANCE_RESULT_HEADER
32 #include "GRTTypedefs.h"
44 testMode = CLASSIFICATION_MODE;
47 predictedClassLabel = 0;
48 unProcessedPredictedClassLabel = 0;
78 this->testMode = rhs.testMode;
79 this->testIteration = rhs.testIteration;
80 this->classLabel = rhs.classLabel;
81 this->predictedClassLabel = rhs.predictedClassLabel;
82 this->unProcessedPredictedClassLabel = rhs.unProcessedPredictedClassLabel;
83 this->classLikelihoods = rhs.classLikelihoods;
84 this->classDistances = rhs.classDistances;
85 this->regressionData = rhs.regressionData;
86 this->targetData = rhs.targetData;
98 bool setClassificationResult(
const unsigned int testIteration,
const unsigned int classLabel,
const unsigned int predictedClassLabel,
const unsigned int unProcessedPredictedClassLabel,
const VectorFloat &classLikelihoods,
const VectorFloat &classDistances){
99 this->testMode = CLASSIFICATION_MODE;
100 this->testIteration = testIteration;
101 this->classLabel = classLabel;
102 this->predictedClassLabel = predictedClassLabel;
103 this->unProcessedPredictedClassLabel = unProcessedPredictedClassLabel;
104 this->classLikelihoods = classLikelihoods;
105 this->classDistances = classDistances;
118 this->testMode = REGRESSION_MODE;
119 this->testIteration = testIteration;
120 this->regressionData = regressionData;
121 this->targetData = targetData;
140 return testIteration;
158 return predictedClassLabel;
167 Float maxLikelihood = 0;
168 for(
size_t i=0; i<classLikelihoods.size(); i++){
169 if( classLikelihoods[i] > maxLikelihood ){
170 maxLikelihood = classLikelihoods[i];
173 return maxLikelihood;
183 if( regressionData.size() != targetData.size() )
return 0;
184 for(
size_t i=0; i<regressionData.size(); i++){
185 sum += (regressionData[i]-targetData[i])*(regressionData[i]-targetData[i]);
191 unsigned int testMode;
192 unsigned int testIteration;
193 unsigned int classLabel;
194 unsigned int predictedClassLabel;
195 unsigned int unProcessedPredictedClassLabel;
203 enum TestMode{CLASSIFICATION_MODE=0,REGRESSION_MODE};
209 #endif //GRT_TEST_INSTANCE_RESULT_HEADER
bool setRegressionResult(const unsigned int testIteration, const VectorFloat ®ressionData, const VectorFloat &targetData)
unsigned int getTestIteration() const
unsigned int getTestMode() const
TestInstanceResult & operator=(const TestInstanceResult &rhs)
bool setClassificationResult(const unsigned int testIteration, const unsigned int classLabel, const unsigned int predictedClassLabel, const unsigned int unProcessedPredictedClassLabel, const VectorFloat &classLikelihoods, const VectorFloat &classDistances)
TestInstanceResult(const TestInstanceResult &rhs)
unsigned int getClassLabel() const
Float getSquaredError() const
Float getMaximumLikelihood() const
unsigned int getPredictedClassLabel() const