Add KDBNew fix computeCPT error

This commit is contained in:
2023-08-05 14:40:42 +02:00
parent a1c6ab18f3
commit 1a09ccca4c
17 changed files with 192 additions and 111 deletions

View File

@@ -146,6 +146,11 @@ namespace platform {
auto y_test = y.index({ test_t });
cout << nfold + 1 << ", " << flush;
clf->fit(X_train, y_train, features, className, states);
cout << endl;
auto lines = clf->show();
for (auto line : lines) {
cout << line << endl;
}
nodes[item] = clf->getNumberOfNodes();
edges[item] = clf->getNumberOfEdges();
num_states[item] = clf->getNumberOfStates();

View File

@@ -7,6 +7,7 @@
#include "KDB.h"
#include "SPODE.h"
#include "TANNew.h"
#include "KDBNew.h"
namespace platform {
class Models {
private:

View File

@@ -8,6 +8,8 @@ static platform::Registrar registrarS("SPODE",
[](void) -> bayesnet::BaseClassifier* { return new bayesnet::SPODE(2);});
static platform::Registrar registrarK("KDB",
[](void) -> bayesnet::BaseClassifier* { return new bayesnet::KDB(2);});
static platform::Registrar registrarKN("KDBNew",
[](void) -> bayesnet::BaseClassifier* { return new bayesnet::KDBNew(2);});
static platform::Registrar registrarA("AODE",
[](void) -> bayesnet::BaseClassifier* { return new bayesnet::AODE();});
#endif