Change Constant smooth type

This commit is contained in:
2024-06-14 10:16:32 +02:00
parent 3d900f8c81
commit 8f92b74260
4 changed files with 7 additions and 9 deletions

View File

@@ -30,7 +30,7 @@ namespace platform {
{"margin", {"0.1", "0.2", "0.3"}}, {"margin", {"0.1", "0.2", "0.3"}},
{"n_folds", {"5", "10"}}, {"n_folds", {"5", "10"}},
{"discretize_algo", {"mdlp", "bin3u", "bin3q", "bin4u", "bin4q"}}, {"discretize_algo", {"mdlp", "bin3u", "bin3q", "bin4u", "bin4q"}},
{"smooth_strat", {"OLD_LAPLACE", "LAPLACE", "CESTNIK"}}, {"smooth_strat", {"ORIGINAL", "LAPLACE", "CESTNIK"}},
{"platform", {"any"}}, {"platform", {"any"}},
{"model", {"any"}}, {"model", {"any"}},
{"seeds", {"any"}}, {"seeds", {"any"}},
@@ -48,7 +48,7 @@ namespace platform {
file << "platform=um790Linux" << std::endl; file << "platform=um790Linux" << std::endl;
file << "n_folds=5" << std::endl; file << "n_folds=5" << std::endl;
file << "discretize_algo=mdlp" << 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 << "stratified=0" << std::endl;
file << "model=TAN" << std::endl; file << "model=TAN" << std::endl;
file << "seeds=[271]" << std::endl; file << "seeds=[271]" << std::endl;

View File

@@ -28,9 +28,8 @@ namespace platform {
Experiment& setSmoothSrategy(const std::string& smooth_strategy) Experiment& setSmoothSrategy(const std::string& smooth_strategy)
{ {
this->smooth_strategy = smooth_strategy; this->result.setSmoothStrategy(smooth_strategy); this->smooth_strategy = smooth_strategy; this->result.setSmoothStrategy(smooth_strategy);
std::cout << "Experiment: Smoothing strategy: [" << smooth_strategy << "]" << std::endl; if (smooth_strategy == "ORIGINAL")
if (smooth_strategy == "OLD_LAPLACE") smooth_type = bayesnet::Smoothing_t::ORIGINAL;
smooth_type = bayesnet::Smoothing_t::OLD_LAPLACE;
else if (smooth_strategy == "LAPLACE") else if (smooth_strategy == "LAPLACE")
smooth_type = bayesnet::Smoothing_t::LAPLACE; smooth_type = bayesnet::Smoothing_t::LAPLACE;
else if (smooth_strategy == "CESTNIK") else if (smooth_strategy == "CESTNIK")
@@ -39,7 +38,6 @@ namespace platform {
std::cerr << "Experiment: Unknown smoothing strategy: " << smooth_strategy << std::endl; std::cerr << "Experiment: Unknown smoothing strategy: " << smooth_strategy << std::endl;
exit(1); exit(1);
} }
std::cout << "Experiment: " << (smooth_type == bayesnet::Smoothing_t::CESTNIK) << " " << static_cast<int>(smooth_type) << std::endl;
return *this; return *this;
} }
Experiment& setLanguageVersion(const std::string& language_version) { this->result.setLanguageVersion(language_version); return *this; } Experiment& setLanguageVersion(const std::string& language_version) { this->result.setLanguageVersion(language_version); return *this; }

View File

@@ -23,9 +23,9 @@ namespace platform {
+ " random seeds. " + data["date"].get<std::string>() + " " + data["time"].get<std::string>() + " random seeds. " + data["date"].get<std::string>() + " " + data["time"].get<std::string>()
); );
sheader << headerLine(data["title"].get<std::string>()); sheader << headerLine(data["title"].get<std::string>());
std::string discretiz_algo = data.find("discretization_algorithm") != data.end() ? data["discretization_algorithm"].get<std::string>() : "OLD_LAPLACE"; std::string discretiz_algo = data.find("discretization_algorithm") != data.end() ? data["discretization_algorithm"].get<std::string>() : "ORIGINAL";
std::string algorithm = data["discretized"].get<bool>() ? " (" + discretiz_algo + ")" : ""; std::string algorithm = data["discretized"].get<bool>() ? " (" + discretiz_algo + ")" : "";
std::string smooth = data.find("smooth_strategy") != data.end() ? data["smooth_strategy"].get<std::string>() : "OLD_LAPLACE"; std::string smooth = data.find("smooth_strategy") != data.end() ? data["smooth_strategy"].get<std::string>() : "ORIGINAL";
sheader << headerLine( sheader << headerLine(
"Random seeds: " + fromVector("seeds") + " Discretized: " + (data["discretized"].get<bool>() ? "True" : "False") + algorithm "Random seeds: " + fromVector("seeds") + " Discretized: " + (data["discretized"].get<bool>() ? "True" : "False") + algorithm
+ " Stratified: " + (data["stratified"].get<bool>() ? "True" : "False") + " Smooth Strategy: " + smooth + " Stratified: " + (data["stratified"].get<bool>() ? "True" : "False") + " Smooth Strategy: " + smooth

View File

@@ -50,7 +50,7 @@ namespace platform {
worksheet_merge_range(worksheet, 1, 0, 1, 12, data["title"].get<std::string>().c_str(), styles["headerRest"]); worksheet_merge_range(worksheet, 1, 0, 1, 12, data["title"].get<std::string>().c_str(), styles["headerRest"]);
worksheet_merge_range(worksheet, 2, 0, 3, 0, ("Score is " + data["score_name"].get<std::string>()).c_str(), styles["headerRest"]); worksheet_merge_range(worksheet, 2, 0, 3, 0, ("Score is " + data["score_name"].get<std::string>()).c_str(), styles["headerRest"]);
writeString(2, 1, "Smooth", "headerRest"); writeString(2, 1, "Smooth", "headerRest");
std::string smooth = data.find("smooth_strategy") != data.end() ? data["smooth_strategy"].get<std::string>() : "OLD_LAPLACE"; std::string smooth = data.find("smooth_strategy") != data.end() ? data["smooth_strategy"].get<std::string>() : "ORIGINAL";
writeString(3, 1, smooth, "headerSmall"); writeString(3, 1, smooth, "headerSmall");
worksheet_merge_range(worksheet, 2, 2, 3, 3, "Execution time", styles["headerRest"]); worksheet_merge_range(worksheet, 2, 2, 3, 3, "Execution time", styles["headerRest"]);
oss << std::setprecision(2) << std::fixed << data["duration"].get<float>() << " s"; oss << std::setprecision(2) << std::fixed << data["duration"].get<float>() << " s";