From 8f3bb47cfd134717ece2de604dbea0d2216456a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Monta=C3=B1ana=20G=C3=B3mez?= Date: Mon, 11 Mar 2024 22:33:50 +0100 Subject: [PATCH] Fix Initialize worse_model_count if model accuracy is better in BoostAODE --- bayesnet/ensembles/BoostAODE.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bayesnet/ensembles/BoostAODE.cc b/bayesnet/ensembles/BoostAODE.cc index 400169d..fba10f3 100644 --- a/bayesnet/ensembles/BoostAODE.cc +++ b/bayesnet/ensembles/BoostAODE.cc @@ -282,6 +282,12 @@ namespace bayesnet { } exitCondition = n_models >= maxModels && repeatSparent || worse_model_count > tolerance; } + if (worse_model_count > tolerance) { + notes.push_back("Convergence threshold reached & last model eliminated"); + significanceModels.pop_back(); + models.pop_back(); + n_models--; + } if (featuresUsed.size() != features.size()) { notes.push_back("Used features in train: " + std::to_string(featuresUsed.size()) + " of " + std::to_string(features.size())); status = WARNING;