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]);
196 return classLikelihoods;
205 return classDistances;
209 unsigned int testMode;
210 unsigned int testIteration;
211 unsigned int classLabel;
212 unsigned int predictedClassLabel;
213 unsigned int unProcessedPredictedClassLabel;
221 enum TestMode{CLASSIFICATION_MODE=0,REGRESSION_MODE};
227 #endif //GRT_TEST_INSTANCE_RESULT_HEADER
unsigned int getTestIteration() const
TestInstanceResult(const TestInstanceResult &rhs)
unsigned int getClassLabel() const
bool setClassificationResult(const unsigned int testIteration, const unsigned int classLabel, const unsigned int predictedClassLabel, const unsigned int unProcessedPredictedClassLabel, const VectorFloat &classLikelihoods, const VectorFloat &classDistances)
VectorFloat getDistances() const
unsigned int getTestMode() const
unsigned int getPredictedClassLabel() const
Float getMaximumLikelihood() const
VectorFloat getClassLikelihoods() const
bool setRegressionResult(const unsigned int testIteration, const VectorFloat ®ressionData, const VectorFloat &targetData)
Float getSquaredError() const
TestInstanceResult & operator=(const TestInstanceResult &rhs)