Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

Evaluation* Impala::Core::Training::MakeEvaluation ( const std::string &  description,
Table::AnnotationTable *  annotation 
)

Factory function for Evaluation objects.

(Might become a method in a factory object)

Please note that the caller will be responsible for deleting the Evaluation objects (duh, it's a factory). Also note that the lifetime of the annotation object should be at least as long as the lifetime of the returned Evaluation object.

Definition at line 27 of file MakeEvaluation.h.

References Impala::atoi(), Impala::Core::Table::AveragePrecision(), Impala::Core::Table::AnnotationTable::GetNrPositive(), ILOG_ERROR, and ILOG_VAR.

Referenced by Impala::Core::Training::Factory::MakeSearcher().

00029     {
00030         ILOG_VAR(Impala.Core.Training.MakeEvaluation);
00031 
00032         if(description == "ap" || 
00033            description == "AP" ||
00034            description == "AveragePrecision")
00035            return new AveragePrecision(annotation);
00036         if(description == "bap" || 
00037            description == "BAP" ||
00038            description == "BalancedAveragePrecision")
00039            return new BalancedAveragePrecision(annotation);
00040         if(description == "auc" || 
00041            description == "AUC" ||
00042            description == "AreaUnderRocCurve")
00043            return new AreaUnderRocCurve(annotation);
00044         if(description.substr(0,2) == "P@")
00045         {
00046             int n = atoi(description.substr(2));
00047             return new PrecisionAtN(annotation, n);
00048         }
00049         if(description.substr(0,10) == "precision@")
00050         {
00051             int n = atoi(description.substr(10));
00052             return new PrecisionAtN(annotation, n);
00053         }
00054         if(description.substr(0,2) == "R@")
00055         {
00056             int n = atoi(description.substr(2));
00057             int totalRelevance = annotation->GetNrPositive();
00058             return new RecallAtN(annotation, n, totalRelevance);
00059         }
00060         if(description.substr(0,10) == "recall@")
00061         {
00062             int n = atoi(description.substr(10));
00063             int totalRelevance = annotation->GetNrPositive();
00064             return new RecallAtN(annotation, n, totalRelevance);
00065         }
00066         ILOG_ERROR("description not recognised" << description);
00067         return new Evaluation(annotation);
00068     }

Here is the call graph for this function:


Generated on Fri Mar 19 11:23:00 2010 for ImpalaSrc by  doxygen 1.5.1