diff --git a/bayesnet/classifiers/.XSPODE.h.swp b/bayesnet/classifiers/.XSPODE.h.swp deleted file mode 100644 index 024d03c..0000000 Binary files a/bayesnet/classifiers/.XSPODE.h.swp and /dev/null differ diff --git a/lib/folding b/lib/folding index 2ac43e3..9652853 160000 --- a/lib/folding +++ b/lib/folding @@ -1 +1 @@ -Subproject commit 2ac43e32ac1eac0c986702ec526cf5367a565ef0 +Subproject commit 9652853d692ed3b8a38d89f70559209ffb988020 diff --git a/sample/sample_xspode.cc b/sample/sample_xspode.cc index a071ae3..48e93c6 100644 --- a/sample/sample_xspode.cc +++ b/sample/sample_xspode.cc @@ -43,16 +43,6 @@ tuple>, std::vector, std::vector, states[className] = std::vector(*max_element(y.begin(), y.end()) + 1); iota(begin(states.at(className)), end(states.at(className)), 0); return { Xr, y, features, className, states }; - // Xd = torch::zeros({ static_cast(Xr.size()), static_cast(Xr[0].size()) }, torch::kInt32); - // for (int i = 0; i < features.size(); ++i) { - // states[features[i]] = std::vector(*max_element(Xr[i].begin(), Xr[i].end()) + 1); - // auto item = states.at(features[i]); - // iota(begin(item), end(item), 0); - // Xd.index_put_({ i, "..." }, torch::tensor(Xr[i], torch::kInt32)); - // } - // states[className] = std::vector(*max_element(y.begin(), y.end()) + 1); - // iota(begin(states.at(className)), end(states.at(className)), 0); - // return { Xd, torch::tensor(y, torch::kInt32), features, className, states }; } int main(int argc, char* argv[]) @@ -62,13 +52,11 @@ int main(int argc, char* argv[]) return 1; } std::string file_name = argv[1]; - // auto clf = bayesnet::BoostAODE(false); // false for not using voting in predict - bayesnet::BaseClassifier* clf = new bayesnet::XSpode(0); // false for not using voting in predict + bayesnet::BaseClassifier* clf = new bayesnet::XSpode(0); std::cout << "Library version: " << clf->getVersion() << std::endl; auto [X, y, features, className, states] = loadDataset(file_name, true); torch::Tensor weights = torch::full({ static_cast(X[0].size()) }, 1.0 / X[0].size(), torch::kDouble); clf->fit(X, y, features, className, states, bayesnet::Smoothing_t::ORIGINAL); - // auto score = clf.score(X, y); auto score = clf->score(X, y); std::cout << "File: " << file_name << " Model: XSpode(0) score: " << score << std::endl; delete clf; diff --git a/tests/lib/catch2 b/tests/lib/catch2 index 506276c..0321d2f 160000 --- a/tests/lib/catch2 +++ b/tests/lib/catch2 @@ -1 +1 @@ -Subproject commit 506276c59217429c93abd2fe9507c7f45eb81072 +Subproject commit 0321d2fce328b5e2ad106a8230ff20e0d5bf5501