diff --git a/src/BayesNet/BoostAODE.cc b/src/BayesNet/BoostAODE.cc index a4379b4..eb8da07 100644 --- a/src/BayesNet/BoostAODE.cc +++ b/src/BayesNet/BoostAODE.cc @@ -16,7 +16,7 @@ namespace bayesnet { auto X_ = dataset.index({ torch::indexing::Slice(0, dataset.size(0) - 1), "..." }); auto y_ = dataset.index({ -1, "..." }); bool exitCondition = false; - bool repeatSparent = true; + bool repeatSparent = false; vector featuresUsed; // Step 0: Set the finish condition // if not repeatSparent a finish condition is run out of features diff --git a/src/Platform/Report.cc b/src/Platform/Report.cc index cc3b0a0..b52a620 100644 --- a/src/Platform/Report.cc +++ b/src/Platform/Report.cc @@ -13,20 +13,27 @@ namespace platform { } string Report::fromVector(const string& key) { - string result = ""; - + stringstream oss; + string sep = ""; + oss << "[" << fixed << setprecision(16); for (auto& item : data[key]) { - result += to_string(item) + ", "; + oss << sep << item.get(); + sep = ", "; } - return "[" + result.substr(0, result.size() - 2) + "]"; + oss << "]"; + return oss.str(); } - string fVector(const json& data) + string fVector(const string& title, const json& data) { - string result = ""; + stringstream oss; + string sep = ""; + oss << title << "[" << fixed << setprecision(16); for (const auto& item : data) { - result += to_string(item) + ", "; + oss << sep << item.get(); + sep = ", "; } - return "[" + result.substr(0, result.size() - 2) + "]"; + oss << "]"; + return oss.str(); } void Report::show() { @@ -86,10 +93,10 @@ namespace platform { } if (data["results"].size() == 1) { cout << string(MAXL, '*') << endl; - cout << headerLine("Train scores: " + fVector(lastResult["scores_train"])); - cout << headerLine("Test scores: " + fVector(lastResult["scores_test"])); - cout << headerLine("Train times: " + fVector(lastResult["times_train"])); - cout << headerLine("Test times: " + fVector(lastResult["times_test"])); + cout << headerLine(fVector("Train scores: ", lastResult["scores_train"])); + cout << headerLine(fVector("Test scores: ", lastResult["scores_test"])); + cout << headerLine(fVector("Train times: ", lastResult["times_train"])); + cout << headerLine(fVector("Test times: ", lastResult["times_test"])); cout << string(MAXL, '*') << endl; } }