diff --git a/README.md b/README.md index d9849bf..426be8d 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,18 @@ Before compiling BayesNet. [Getting Started]() +The best option is install the packages that the Linux distribution have in its repository. If this is the case: + +```bash +sudo dnf install boost-devel +``` + +If this is not possible and the compressed packaged is installed, the following environment variable has to be set: + +```bash +export BOOST_ROOT=/path/to/library/ +``` + ### libxlswriter ```bash diff --git a/src/Platform/BestResults.cc b/src/Platform/BestResults.cc index b18cc35..d2b27ef 100644 --- a/src/Platform/BestResults.cc +++ b/src/Platform/BestResults.cc @@ -290,6 +290,7 @@ namespace platform { if (excel) { BestResultsExcel excel(score, models, datasets, table, friedman, significance); excel.build(); + cout << Colors::YELLOW() << "** Excel file generated: " << excel.getFileName() << Colors::RESET() << endl; } } } \ No newline at end of file diff --git a/src/Platform/BestResultsExcel.cc b/src/Platform/BestResultsExcel.cc index 3fb75ba..d536f93 100644 --- a/src/Platform/BestResultsExcel.cc +++ b/src/Platform/BestResultsExcel.cc @@ -37,6 +37,10 @@ namespace platform { body(); footer(); } + string BestResultsExcel::getFileName() + { + return Paths::excel() + fileName; + } void BestResultsExcel::header() { row = 0; @@ -123,14 +127,27 @@ namespace platform { writeString(row, 6, "Loss", "bodyHeader"); writeString(row, 7, "Reject H0", "bodyHeader"); row++; + bool first = true; for (const auto& item : holmResult.holmLines) { writeString(row, 1, item.model, "text"); - writeDouble(row, 2, item.pvalue, "result"); - writeDouble(row, 3, item.rank, "result"); - writeInt(row, 4, item.wtl.win, "ints"); - writeInt(row, 5, item.wtl.tie, "ints"); - writeInt(row, 6, item.wtl.loss, "ints"); - writeString(row, 7, item.reject ? "Yes" : "No", "textCentered"); + if (first) { + // Control model info + first = false; + writeString(row, 2, "", "text"); + writeDouble(row, 3, item.rank, "result"); + writeString(row, 4, "", "text"); + writeString(row, 5, "", "text"); + writeString(row, 6, "", "text"); + writeString(row, 7, "", "textCentered"); + } else { + // Rest of the models info + writeDouble(row, 2, item.pvalue, "result"); + writeDouble(row, 3, item.rank, "result"); + writeInt(row, 4, item.wtl.win, "ints"); + writeInt(row, 5, item.wtl.tie, "ints"); + writeInt(row, 6, item.wtl.loss, "ints"); + writeString(row, 7, item.reject ? "Yes" : "No", "textCentered"); + } row++; } } diff --git a/src/Platform/BestResultsExcel.h b/src/Platform/BestResultsExcel.h index 703298b..93eb017 100644 --- a/src/Platform/BestResultsExcel.h +++ b/src/Platform/BestResultsExcel.h @@ -14,6 +14,7 @@ namespace platform { BestResultsExcel(string score, vector models, vector datasets, json table, bool friedman, double significance); ~BestResultsExcel(); void build(); + string getFileName(); private: void header(); void body(); diff --git a/src/Platform/Statistics.cc b/src/Platform/Statistics.cc index b3ae878..10cf91c 100644 --- a/src/Platform/Statistics.cc +++ b/src/Platform/Statistics.cc @@ -161,10 +161,10 @@ namespace platform { sort(ranksOrder.begin(), ranksOrder.end(), [](const pair& a, const pair& b) { return a.second < b.second; }); + // Show the control model info. + oss << " " << Colors::BLUE() << left << setw(maxModelName) << ranksOrder.at(0).first << " "; + oss << setw(12) << " " << setprecision(7) << fixed << " " << ranksOrder.at(0).second << endl; for (const auto& item : ranksOrder) { - if (item.first == models.at(controlIdx)) { - continue; - } auto idx = distance(models.begin(), find(models.begin(), models.end(), item.first)); double pvalue = 0.0; for (const auto& stat : statsOrder) { @@ -172,13 +172,17 @@ namespace platform { pvalue = stat.second; } } + holmResult.holmLines.push_back({ item.first, pvalue, item.second, wtl.at(idx), pvalue < significance }); + if (item.first == models.at(controlIdx)) { + continue; + } auto colorStatus = pvalue > significance ? Colors::GREEN() : Colors::MAGENTA(); auto status = pvalue > significance ? Symbols::check_mark : Symbols::cross; auto textStatus = pvalue > significance ? " accepted H0" : " rejected H0"; - oss << " " << colorStatus << left << setw(maxModelName) << item.first << " " << setprecision(6) << scientific << pvalue << setprecision(7) << fixed << " " << item.second; + oss << " " << colorStatus << left << setw(maxModelName) << item.first << " "; + oss << setprecision(6) << scientific << pvalue << setprecision(7) << fixed << " " << item.second; oss << " " << right << setw(3) << wtl.at(idx).win << " " << setw(3) << wtl.at(idx).tie << " " << setw(4) << wtl.at(idx).loss; oss << " " << status << textStatus << endl; - holmResult.holmLines.push_back({ item.first, pvalue, item.second, wtl.at(idx), pvalue < significance }); } oss << color << " *************************************************************************************************************" << endl; oss << Colors::RESET();