test to construct DecisionTreeFactor from DiscreteConditional

release/4.3a0
Varun Agrawal 2023-06-28 18:24:39 -04:00
parent 0515329c38
commit 3ee46ec280
1 changed files with 5 additions and 0 deletions

View File

@ -51,6 +51,11 @@ TEST( DecisionTreeFactor, constructors)
// Assert that error = -log(value) // Assert that error = -log(value)
EXPECT_DOUBLES_EQUAL(-log(f1(values)), f1.error(values), 1e-9); EXPECT_DOUBLES_EQUAL(-log(f1(values)), f1.error(values), 1e-9);
// Construct from DiscreteConditional
DiscreteConditional conditional(X | Y = "1/1 2/3 1/4");
DecisionTreeFactor f4(conditional);
EXPECT_DOUBLES_EQUAL(0.8, f4(values), 1e-9);
} }
/* ************************************************************************* */ /* ************************************************************************* */