Move tests library to tests/lib

Add PBC4cip classifier
This commit is contained in:
2025-01-09 10:04:16 +01:00
parent 5ec59b80ab
commit 9966ba4af8
14 changed files with 49 additions and 211 deletions

View File

@@ -135,4 +135,14 @@ TEST_CASE("XGBoost", "[PyClassifiers]")
// // REQUIRE(sum == Catch::Approx(1.0).epsilon(raw.epsilon));
// }
// std::cout << predict << std::endl;
// }
// }
TEST_CASE("PBC4cip", "[PyClassifiers]")
{
auto raw = RawDatasets("iris", true);
auto clf = pywrap::PBC4cip();
clf.fit(raw.Xt, raw.yt, raw.featurest, raw.classNamet, raw.statest);
nlohmann::json hyperparameters = { };
clf.setHyperparameters(hyperparameters);
auto score = clf.score(raw.Xt, raw.yt);
REQUIRE(score == Catch::Approx(0.98).epsilon(raw.epsilon));
}