21 #define GRT_DLL_EXPORTS 23 #include "../DataStructures/ClassificationData.h" 24 #include "../CoreModules/Classifier.h" 36 if( !model.getTrained() )
return false;
38 const UINT M = data.getNumSamples();
40 for(UINT i=0; i<M; i++){
41 if( !model.predict( data[i].getSample() ) ){
46 if( model.getPredictedClassLabel() == data[i].getClassLabel() ){
52 accuracy = accuracy /
static_cast<Float
>(M) * 100.0;
This file contains the Metrics class, it can be used to compute common metrics such as accuracy...
static bool computeAccuracy(Classifier &model, const ClassificationData &data, Float &accuracy)