Fix Nodes, Leaves, Depth vs Nodes, Edges, States headers in reports

This commit is contained in:
2024-04-21 11:05:12 +02:00
parent 1caa39c071
commit 33cfb78554
5 changed files with 17 additions and 3 deletions

View File

@@ -15,6 +15,10 @@ namespace platform {
{Symbols::cross, "Less than or equal to ZeroR"},
{Symbols::upward_arrow, oss.str()}
};
auto env = DotEnv();
nodes_label = env.get("nodes");
leaves_label = env.get("leaves");
depth_label = env.get("depth");
}
std::string ReportBase::fromVector(const std::string& key)
{

View File

@@ -27,6 +27,9 @@ namespace platform {
double margin;
std::map<std::string, std::string> meaning;
bool compare;
std::string nodes_label;
std::string leaves_label;
std::string depth_label;
private:
double bestResult(const std::string& dataset, const std::string& model);
json bestResults;

View File

@@ -61,7 +61,7 @@ namespace platform {
maxHyper = std::max(maxHyper, (int)r["hyperparameters"].dump().size());
maxDataset = std::max(maxDataset, (int)r["dataset"].get<std::string>().size());
}
std::vector<std::string> header_labels = { " #", "Dataset", "Sampl.", "Feat.", "Cls", "Nodes", "Edges", "Depth", "Score", "Time", "Hyperparameters" };
std::vector<std::string> header_labels = { " #", "Dataset", "Sampl.", "Feat.", "Cls", nodes_label, leaves_label, depth_label, "Score", "Time", "Hyperparameters" };
sheader << Colors::GREEN();
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++) {

View File

@@ -4,6 +4,10 @@ namespace platform {
ReportExcelCompared::ReportExcelCompared(json& data_A, json& data_B) : data_A(data_A), data_B(data_B), ExcelFile(NULL, NULL)
{
auto env = DotEnv();
nodes_label = env.get("nodes");
leaves_label = env.get("leaves");
depth_label = env.get("depth");
}
ReportExcelCompared::~ReportExcelCompared()
{
@@ -61,7 +65,7 @@ namespace platform {
// Body Header
auto sizes = std::vector<int>({ 22, 10, 9, 7, 12, 12, 9, 12, 12, 9, 12, 12, 9, 12, 12, 9, 12, 12, 9, 15, 15, 9, 15, 15 });
auto head_a = std::vector<std::string>({ "Dataset", "Samples", "Features", "Classes" });
auto head_b = std::vector<std::string>({ "Models", "Nodes", "Edges", "States", "Score", "Time" });
auto head_b = std::vector<std::string>({ "Models", nodes_label, leaves_label, depth_label, "Score", "Time" });
int headerRow = 3;
int col = 0;
for (const auto& item : head_a) {
@@ -87,7 +91,7 @@ namespace platform {
row = headerRow + 2;
int hypSize_A = 15;
int hypSize_B = 15;
auto compared = std::vector<std::string>({ "models", "nodes", "leaves", "depth", "score", "time" });
auto compared = std::vector<std::string>({ "models", nodes_label, leaves_label, "depth", "score", "time" });
auto compared_data = std::vector<double>(compared.size(), 0.0);
auto totals_A = std::vector<double>(compared.size(), 0.0);
auto totals_B = std::vector<double>(compared.size(), 0.0);

View File

@@ -12,5 +12,8 @@ namespace platform {
void footer(std::vector<double>& totals_A, std::vector<double>& totals_B, int row);
json& data_A;
json& data_B;
std::string nodes_label;
std::string leaves_label;
std::string depth_label;
};
};