mirror of
https://github.com/rmontanana/mdlp.git
synced 2025-08-15 23:45:57 +00:00
refactor system types in library
Add new test taken from join_fit in FImdlp python Update instructions in README
This commit is contained in:
@@ -30,6 +30,14 @@ namespace mdlp {
|
||||
ASSERT_NEAR(0.468996f, entropy(0, 10), precision);
|
||||
}
|
||||
|
||||
TEST_F(TestMetrics, EntropyDouble) {
|
||||
y = {0, 0, 1, 2, 3};
|
||||
samples_t expected_entropies = {0.0, 0.0, 0.91829583, 1.5, 1.4575424759098898};
|
||||
for (auto idx = 0; idx < y.size(); ++idx) {
|
||||
ASSERT_NEAR(expected_entropies[idx], entropy(0, idx + 1), precision);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(TestMetrics, InformationGain) {
|
||||
ASSERT_NEAR(1, informationGain(0, 5, 10), precision);
|
||||
ASSERT_NEAR(1, informationGain(0, 5, 10), precision); // For cache
|
||||
|
Reference in New Issue
Block a user