Force mutual information methods to be at least 0

There were cases where a tiny negative number was returned (less than -1e-7)
Fix mst glass test that is affected with this change
This commit is contained in:
2024-05-17 11:15:45 +02:00
parent 291ba0fb0e
commit 2584e8294d
4 changed files with 8 additions and 18 deletions

View File

@@ -22,7 +22,7 @@ TEST_CASE("Build basic model", "[BoostA2DE]")
REQUIRE(clf.getNumberOfEdges() == 684);
REQUIRE(clf.getNotes().size() == 3);
REQUIRE(clf.getNotes()[0] == "Convergence threshold reached & 15 models eliminated");
REQUIRE(clf.getNotes()[1] == "Used pairs not used in train: 20");
REQUIRE(clf.getNotes()[1] == "Pairs not used in train: 20");
REQUIRE(clf.getNotes()[2] == "Number of models: 38");
auto score = clf.score(raw.Xv, raw.yv);
REQUIRE(score == Catch::Approx(0.919271).epsilon(raw.epsilon));