Fix Nodes, Leaves, Depth vs Nodes, Edges, States headers in reports
This commit is contained in:
@@ -15,6 +15,10 @@ namespace platform {
|
|||||||
{Symbols::cross, "Less than or equal to ZeroR"},
|
{Symbols::cross, "Less than or equal to ZeroR"},
|
||||||
{Symbols::upward_arrow, oss.str()}
|
{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)
|
std::string ReportBase::fromVector(const std::string& key)
|
||||||
{
|
{
|
||||||
|
@@ -27,6 +27,9 @@ namespace platform {
|
|||||||
double margin;
|
double margin;
|
||||||
std::map<std::string, std::string> meaning;
|
std::map<std::string, std::string> meaning;
|
||||||
bool compare;
|
bool compare;
|
||||||
|
std::string nodes_label;
|
||||||
|
std::string leaves_label;
|
||||||
|
std::string depth_label;
|
||||||
private:
|
private:
|
||||||
double bestResult(const std::string& dataset, const std::string& model);
|
double bestResult(const std::string& dataset, const std::string& model);
|
||||||
json bestResults;
|
json bestResults;
|
||||||
|
@@ -61,7 +61,7 @@ namespace platform {
|
|||||||
maxHyper = std::max(maxHyper, (int)r["hyperparameters"].dump().size());
|
maxHyper = std::max(maxHyper, (int)r["hyperparameters"].dump().size());
|
||||||
maxDataset = std::max(maxDataset, (int)r["dataset"].get<std::string>().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();
|
sheader << Colors::GREEN();
|
||||||
std::vector<int> header_lengths = { 3, maxDataset, 6, 5, 3, 9, 9, 9, 15, 20, 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++) {
|
for (int i = 0; i < header_labels.size(); i++) {
|
||||||
|
@@ -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)
|
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()
|
ReportExcelCompared::~ReportExcelCompared()
|
||||||
{
|
{
|
||||||
@@ -61,7 +65,7 @@ namespace platform {
|
|||||||
// Body Header
|
// 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 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_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 headerRow = 3;
|
||||||
int col = 0;
|
int col = 0;
|
||||||
for (const auto& item : head_a) {
|
for (const auto& item : head_a) {
|
||||||
@@ -87,7 +91,7 @@ namespace platform {
|
|||||||
row = headerRow + 2;
|
row = headerRow + 2;
|
||||||
int hypSize_A = 15;
|
int hypSize_A = 15;
|
||||||
int hypSize_B = 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 compared_data = std::vector<double>(compared.size(), 0.0);
|
||||||
auto totals_A = 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);
|
auto totals_B = std::vector<double>(compared.size(), 0.0);
|
||||||
|
@@ -12,5 +12,8 @@ namespace platform {
|
|||||||
void footer(std::vector<double>& totals_A, std::vector<double>& totals_B, int row);
|
void footer(std::vector<double>& totals_A, std::vector<double>& totals_B, int row);
|
||||||
json& data_A;
|
json& data_A;
|
||||||
json& data_B;
|
json& data_B;
|
||||||
|
std::string nodes_label;
|
||||||
|
std::string leaves_label;
|
||||||
|
std::string depth_label;
|
||||||
};
|
};
|
||||||
};
|
};
|
Reference in New Issue
Block a user