00001 #ifndef Impala_Core_Table_BestFile_h
00002 #define Impala_Core_Table_BestFile_h
00003
00004 #include "Util/PropertySet.h"
00005 #include "Link/Svm/LinkSvm.h"
00006
00007 namespace Impala
00008 {
00009 namespace Core
00010 {
00011 namespace Training
00012 {
00013
00014 int
00015 BestFileDiff(Util::PropertySet* set1, Util::PropertySet* set2)
00016 {
00017 svm_parameter* params1 = MakeSvmParams(set1, 0, 0);
00018 svm_parameter* params2 = MakeSvmParams(set2, 0, 0);
00019 const int svmParamCount = 13;
00020 const String svmParamList[svmParamCount] =
00021 {"C", "cache", "coef0", "degree", "gamma", "eps", "kernel", "nu", "p",
00022 "probability", "shrinking", "w1", "w2"};
00023 int diff = Impala::Diff(params1, params2, false);
00024 if (set1->GetDouble("score", -1) != set1->GetDouble("score", -1))
00025 diff++;
00026 delete params1;
00027 delete params2;
00028 return diff;
00029 }
00030
00031 int
00032 BestFileReferenceDiff(Util::PropertySet* set1, Util::PropertySet* set2)
00033 {
00034 ILOG_FUNCTION(Impala.Core.Training.BestFileReferenceDiff);
00035 int diff = BestFileDiff(set1, set2);
00036 if (diff > 0)
00037 ILOG_ERROR("Found "<< diff <<" differences");
00038 return diff;
00039 }
00040
00041
00042 }
00043 }
00044 }
00045
00046 #endif