From 8f92b74260577de326959436b72a2334c037cb9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Monta=C3=B1ana=20G=C3=B3mez?= Date: Fri, 14 Jun 2024 10:16:32 +0200 Subject: [PATCH] Change Constant smooth type --- src/common/DotEnv.h | 4 ++-- src/main/Experiment.h | 6 ++---- src/reports/ReportConsole.cpp | 4 ++-- src/reports/ReportExcel.cpp | 2 +- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/common/DotEnv.h b/src/common/DotEnv.h index 6ad2dea..e3cbbad 100644 --- a/src/common/DotEnv.h +++ b/src/common/DotEnv.h @@ -30,7 +30,7 @@ namespace platform { {"margin", {"0.1", "0.2", "0.3"}}, {"n_folds", {"5", "10"}}, {"discretize_algo", {"mdlp", "bin3u", "bin3q", "bin4u", "bin4q"}}, - {"smooth_strat", {"OLD_LAPLACE", "LAPLACE", "CESTNIK"}}, + {"smooth_strat", {"ORIGINAL", "LAPLACE", "CESTNIK"}}, {"platform", {"any"}}, {"model", {"any"}}, {"seeds", {"any"}}, @@ -48,7 +48,7 @@ namespace platform { file << "platform=um790Linux" << std::endl; file << "n_folds=5" << std::endl; file << "discretize_algo=mdlp" << std::endl; - file << "smooth_strat=OLD_LAPLACE" << std::endl; + file << "smooth_strat=ORIGINAL" << std::endl; file << "stratified=0" << std::endl; file << "model=TAN" << std::endl; file << "seeds=[271]" << std::endl; diff --git a/src/main/Experiment.h b/src/main/Experiment.h index 84860b6..26888ce 100644 --- a/src/main/Experiment.h +++ b/src/main/Experiment.h @@ -28,9 +28,8 @@ namespace platform { Experiment& setSmoothSrategy(const std::string& smooth_strategy) { this->smooth_strategy = smooth_strategy; this->result.setSmoothStrategy(smooth_strategy); - std::cout << "Experiment: Smoothing strategy: [" << smooth_strategy << "]" << std::endl; - if (smooth_strategy == "OLD_LAPLACE") - smooth_type = bayesnet::Smoothing_t::OLD_LAPLACE; + if (smooth_strategy == "ORIGINAL") + smooth_type = bayesnet::Smoothing_t::ORIGINAL; else if (smooth_strategy == "LAPLACE") smooth_type = bayesnet::Smoothing_t::LAPLACE; else if (smooth_strategy == "CESTNIK") @@ -39,7 +38,6 @@ namespace platform { std::cerr << "Experiment: Unknown smoothing strategy: " << smooth_strategy << std::endl; exit(1); } - std::cout << "Experiment: " << (smooth_type == bayesnet::Smoothing_t::CESTNIK) << " " << static_cast(smooth_type) << std::endl; return *this; } Experiment& setLanguageVersion(const std::string& language_version) { this->result.setLanguageVersion(language_version); return *this; } diff --git a/src/reports/ReportConsole.cpp b/src/reports/ReportConsole.cpp index 3c9ddbb..ccc5a87 100644 --- a/src/reports/ReportConsole.cpp +++ b/src/reports/ReportConsole.cpp @@ -23,9 +23,9 @@ namespace platform { + " random seeds. " + data["date"].get() + " " + data["time"].get() ); sheader << headerLine(data["title"].get()); - std::string discretiz_algo = data.find("discretization_algorithm") != data.end() ? data["discretization_algorithm"].get() : "OLD_LAPLACE"; + std::string discretiz_algo = data.find("discretization_algorithm") != data.end() ? data["discretization_algorithm"].get() : "ORIGINAL"; std::string algorithm = data["discretized"].get() ? " (" + discretiz_algo + ")" : ""; - std::string smooth = data.find("smooth_strategy") != data.end() ? data["smooth_strategy"].get() : "OLD_LAPLACE"; + std::string smooth = data.find("smooth_strategy") != data.end() ? data["smooth_strategy"].get() : "ORIGINAL"; sheader << headerLine( "Random seeds: " + fromVector("seeds") + " Discretized: " + (data["discretized"].get() ? "True" : "False") + algorithm + " Stratified: " + (data["stratified"].get() ? "True" : "False") + " Smooth Strategy: " + smooth diff --git a/src/reports/ReportExcel.cpp b/src/reports/ReportExcel.cpp index 0acd714..8a70b6d 100644 --- a/src/reports/ReportExcel.cpp +++ b/src/reports/ReportExcel.cpp @@ -50,7 +50,7 @@ namespace platform { worksheet_merge_range(worksheet, 1, 0, 1, 12, data["title"].get().c_str(), styles["headerRest"]); worksheet_merge_range(worksheet, 2, 0, 3, 0, ("Score is " + data["score_name"].get()).c_str(), styles["headerRest"]); writeString(2, 1, "Smooth", "headerRest"); - std::string smooth = data.find("smooth_strategy") != data.end() ? data["smooth_strategy"].get() : "OLD_LAPLACE"; + std::string smooth = data.find("smooth_strategy") != data.end() ? data["smooth_strategy"].get() : "ORIGINAL"; writeString(3, 1, smooth, "headerSmall"); worksheet_merge_range(worksheet, 2, 2, 3, 3, "Execution time", styles["headerRest"]); oss << std::setprecision(2) << std::fixed << data["duration"].get() << " s";