Add message of not exist Best Results
This commit is contained in:
parent
fc81730dfc
commit
8257a6ae39
@ -94,6 +94,8 @@ namespace platform {
|
||||
ifstream resultData(Paths::results() + "/" + fileName);
|
||||
if (resultData.is_open()) {
|
||||
bestResults = json::parse(resultData);
|
||||
} else {
|
||||
existBestFile = false;
|
||||
}
|
||||
}
|
||||
try {
|
||||
@ -101,7 +103,12 @@ namespace platform {
|
||||
}
|
||||
catch (exception) {
|
||||
value = 1.0;
|
||||
|
||||
}
|
||||
return value;
|
||||
}
|
||||
bool ReportBase::getExistBestFile()
|
||||
{
|
||||
return existBestFile;
|
||||
}
|
||||
}
|
@ -28,6 +28,7 @@ namespace platform {
|
||||
json data;
|
||||
string fromVector(const string& key);
|
||||
string fVector(const string& title, const json& data, const int width, const int precision);
|
||||
bool getExistBestFile();
|
||||
virtual void header() = 0;
|
||||
virtual void body() = 0;
|
||||
virtual void showSummary() = 0;
|
||||
@ -35,10 +36,11 @@ namespace platform {
|
||||
map<string, int> summary;
|
||||
double margin;
|
||||
map<string, string> meaning;
|
||||
bool compare;
|
||||
private:
|
||||
double bestResult(const string& dataset, const string& model);
|
||||
bool compare;
|
||||
json bestResults;
|
||||
bool existBestFile = true;
|
||||
};
|
||||
};
|
||||
#endif
|
@ -104,6 +104,9 @@ namespace platform {
|
||||
oss << score << " compared to " << BestResult::title() << " .: " << totalScore / BestResult::score();
|
||||
cout << headerLine(oss.str());
|
||||
}
|
||||
if (!getExistBestFile() && compare) {
|
||||
cout << headerLine("*** Best Results File not found. Couldn't compare any result!");
|
||||
}
|
||||
cout << string(MAXL, '*') << endl << Colors::RESET();
|
||||
}
|
||||
}
|
@ -326,5 +326,8 @@ namespace platform {
|
||||
worksheet_merge_range(worksheet, row, 1, row, 5, (score + " compared to " + BestResult::title() + " .:").c_str(), efectiveStyle("text"));
|
||||
writeDouble(row, 6, totalScore / BestResult::score(), "result");
|
||||
}
|
||||
if (!getExistBestFile() && compare) {
|
||||
worksheet_write_string(worksheet, row + 1, 0, "*** Best Results File not found. Couldn't compare any result!", styles["summaryStyle"]);
|
||||
}
|
||||
}
|
||||
}
|
@ -300,7 +300,7 @@ namespace platform {
|
||||
if (openExcel) {
|
||||
workbook_close(workbook);
|
||||
}
|
||||
cout << "Done!" << endl;
|
||||
cout << Colors::RESET() << "Done!" << endl;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user