Fix some console report formats

This commit is contained in:
2024-04-02 10:23:32 +02:00
parent 622b36b2c7
commit 0dd10bcbe4

View File

@@ -64,7 +64,7 @@ namespace platform {
}
std::vector<std::string> header_labels = { " #", "Dataset", "Sampl.", "Feat.", "Cls", "Nodes", "Edges", "Depth", "Score", "Time", "Hyperparameters" };
sheader << Colors::GREEN();
std::vector<int> header_lengths = { 3, maxDataset, 6, 5, 3, 9, 9, 9, 8, 12, maxHyper };
std::vector<int> header_lengths = { 3, maxDataset, 6, 5, 3, 9, 9, 9, 15, 20, maxHyper };
for (int i = 0; i < header_labels.size(); i++) {
sheader << std::setw(header_lengths[i]) << std::left << header_labels[i] << " ";
}
@@ -73,6 +73,7 @@ namespace platform {
sheader << std::string(header_lengths[i], '=') << " ";
}
sheader << std::endl;
std::cout << sheader.str();
json lastResult;
double totalScore = 0.0;
int index = 0;
@@ -84,11 +85,7 @@ namespace platform {
auto color = (index % 2) ? Colors::CYAN() : Colors::BLUE();
std::stringstream line;
line << color;
std::string separator{ " " };
if (r.find("notes") != r.end()) {
separator = r["notes"].size() > 0 ? Colors::YELLOW() + Symbols::notebook + color : " ";
}
line << std::setw(3) << std::right << index++ << separator;
line << std::setw(3) << std::right << index++ << " ";
line << std::setw(maxDataset) << std::left << r["dataset"].get<std::string>() << " ";
line << std::setw(6) << std::right << r["samples"].get<int>() << " ";
line << std::setw(5) << std::right << r["features"].get<int>() << " ";
@@ -99,7 +96,7 @@ namespace platform {
line << std::setw(8) << std::right << std::setprecision(6) << std::fixed << r["score"].get<double>() << "±" << std::setw(6) << std::setprecision(4) << std::fixed << r["score_std"].get<double>();
const std::string status = compareResult(r["dataset"].get<std::string>(), r["score"].get<double>());
line << status;
line << std::setw(12) << std::right << std::setprecision(6) << std::fixed << r["time"].get<double>() << "±" << std::setw(6) << std::setprecision(4) << std::fixed << r["time_std"].get<double>() << " ";
line << std::setw(12) << std::right << std::setprecision(6) << std::fixed << r["time"].get<double>() << "±" << std::setw(7) << std::setprecision(4) << std::fixed << r["time_std"].get<double>() << " ";
line << r["hyperparameters"].dump();
line << std::endl;
vbody.push_back(line.str());