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

@@ -32,6 +32,7 @@ namespace bayesnet {
for (int j = i + 1; j < featuresSelected.size(); j++) {
auto parents = { featuresSelected[i], featuresSelected[j] };
std::unique_ptr<Classifier> model = std::make_unique<SPnDE>(parents);
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
@@ -96,6 +97,7 @@ namespace bayesnet {
pairSelection.erase(pairSelection.begin());
std::unique_ptr<Classifier> model;
model = std::make_unique<SPnDE>(std::vector<int>({ feature_pair.first, feature_pair.second }));
model->setSmoothing(smoothing);
model->fit(dataset, features, className, states, weights_);
alpha_t = 0.0;
if (!block_update) {