Add Classification report to end of experiment if only one dataset is tested
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user