From fa26aa80f7407d217b1a21360956e2f3f1dcc52b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Monta=C3=B1ana=20G=C3=B3mez?= Date: Thu, 13 Jun 2024 15:04:15 +0200 Subject: [PATCH] Rename OLD_LAPLACE to ORIGINAL --- bayesnet/classifiers/Proposal.cc | 2 +- bayesnet/network/Network.cc | 2 +- bayesnet/network/Network.h | 2 +- tests/TestUtils.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bayesnet/classifiers/Proposal.cc b/bayesnet/classifiers/Proposal.cc index a5d5f12..6fce507 100644 --- a/bayesnet/classifiers/Proposal.cc +++ b/bayesnet/classifiers/Proposal.cc @@ -70,7 +70,7 @@ namespace bayesnet { states[pFeatures[index]] = xStates; } const torch::Tensor weights = torch::full({ pDataset.size(1) }, 1.0 / pDataset.size(1), torch::kDouble); - model.fit(pDataset, weights, pFeatures, pClassName, states, Smoothing_t::OLD_LAPLACE); + model.fit(pDataset, weights, pFeatures, pClassName, states, Smoothing_t::ORIGINAL); } return states; } diff --git a/bayesnet/network/Network.cc b/bayesnet/network/Network.cc index d028bb6..b19a054 100644 --- a/bayesnet/network/Network.cc +++ b/bayesnet/network/Network.cc @@ -198,7 +198,7 @@ namespace bayesnet { double numStates = static_cast(node.second->getNumStates()); double smoothing_factor = 0.0; switch (smoothing) { - case Smoothing_t::OLD_LAPLACE: + case Smoothing_t::ORIGINAL: smoothing_factor = 1.0 / n_samples; break; case Smoothing_t::LAPLACE: diff --git a/bayesnet/network/Network.h b/bayesnet/network/Network.h index b3417cd..3485e64 100644 --- a/bayesnet/network/Network.h +++ b/bayesnet/network/Network.h @@ -14,7 +14,7 @@ namespace bayesnet { enum class Smoothing_t { NONE = -1, - OLD_LAPLACE = 0, + ORIGINAL = 0, LAPLACE, CESTNIK }; diff --git a/tests/TestUtils.h b/tests/TestUtils.h index b986278..652680b 100644 --- a/tests/TestUtils.h +++ b/tests/TestUtils.h @@ -33,7 +33,7 @@ public: bool discretize; int num_samples = 0; bool shuffle = false; - bayesnet::Smoothing_t smoothing = bayesnet::Smoothing_t::OLD_LAPLACE; + bayesnet::Smoothing_t smoothing = bayesnet::Smoothing_t::ORIGINAL; private: std::string to_string() {