Implement 3 types of smoothing

This commit is contained in:
2024-06-10 15:49:01 +02:00
parent 684443a788
commit 27a3e5a5e0
11 changed files with 37 additions and 9 deletions

View File

@@ -22,6 +22,7 @@ namespace bayesnet {
std::vector<int> featuresSelected = featureSelection(weights_);
for (const int& feature : featuresSelected) {
std::unique_ptr<Classifier> model = std::make_unique<SPODE>(feature);
model->setSmoothing(smoothing);
model->fit(dataset, features, className, states, weights_);
models.push_back(std::move(model));
significanceModels.push_back(1.0); // They will be updated later in trainModel
@@ -89,6 +90,7 @@ namespace bayesnet {
featureSelection.erase(featureSelection.begin());
std::unique_ptr<Classifier> model;
model = std::make_unique<SPODE>(feature);
model->setSmoothing(smoothing);
model->fit(dataset, features, className, states, weights_);
alpha_t = 0.0;
if (!block_update) {