Add Classification report to end of experiment if only one dataset is tested

This commit is contained in:
2024-05-10 14:11:51 +02:00
parent ec0268c514
commit 6d4117d188
6 changed files with 24 additions and 4 deletions

View File

@@ -3,6 +3,7 @@
#include "best/BestScore.h"
#include "common/CLocale.h"
#include "ReportConsole.h"
#include "main/Scores.h"
namespace platform {
std::string ReportConsole::headerLine(const std::string& text, int utf = 0)
@@ -164,4 +165,16 @@ namespace platform {
std::cout << headerLine("*** Best Results File not found. Couldn't compare any result!");
}
}
void ReportConsole::showClassificationReport()
{
if (data["results"].size() > 1)
return;
auto item = data["results"][0];
auto scores = Scores(item["confusion_matrices"][0]);
for (int i = 1; i < item["confusion_matrices"].size(); i++) {
auto score = Scores(item["confusion_matrices"][i]);
scores.aggregate(score);
}
std::cout << Colors::BLUE() << scores.classification_report() << Colors::RESET();
}
}

View File

@@ -14,6 +14,7 @@ namespace platform {
std::string fileReport();
std::string getHeader() { do_header(); do_body(); return sheader.str(); }
std::vector<std::string>& getBody() { return vbody; }
void showClassificationReport();
private:
int selectedIndex;
std::string headerLine(const std::string& text, int utf);