[pyAgrum] adapt test for pyAgrum with new GibbsSampling

parent f670423d
......@@ -80,16 +80,16 @@ class TestDictFeature(GibbsTestCase):
def testDictOfSequences(self):
ie = gum.GibbsSampling(self.bn)
ie.setVerbosity(False)
ie.setEpsilon(0.0001)
ie.setMinEpsilonRate(0.0001)
ie.setEpsilon(0.01)
ie.setMinEpsilonRate(0.01)
ie.setEvidence({'s': [0, 1], 'w': (1, 0)})
ie.makeInference()
result = ie.posterior(self.r)
ie2 = gum.GibbsSampling(self.bn)
ie2.setVerbosity(False)
ie2.setEpsilon(0.0001)
ie2.setMinEpsilonRate(0.0001)
ie2.setEpsilon(0.01)
ie2.setMinEpsilonRate(0.01)
ie2.setEvidence({'s': 1, 'w': 0})
ie2.makeInference()
result2 = ie2.posterior(self.r)
......@@ -99,16 +99,16 @@ class TestDictFeature(GibbsTestCase):
def testDictOfLabels(self):
ie = gum.GibbsSampling(self.bn)
ie.setVerbosity(False)
ie.setEpsilon(0.0001)
ie.setMinEpsilonRate(0.0001)
ie.setEpsilon(0.01)
ie.setMinEpsilonRate(0.01)
ie.setEvidence({'s': 0, 'w': 1})
ie.makeInference()
result = ie.posterior(self.r).tolist()
ie2 = gum.GibbsSampling(self.bn)
ie2.setVerbosity(False)
ie2.setEpsilon(0.0001)
ie2.setMinEpsilonRate(0.0001)
ie2.setEpsilon(0.01)
ie2.setMinEpsilonRate(0.01)
ie2.setEvidence({'s': 'no', 'w': 'yes'})
ie2.makeInference()
result2 = ie2.posterior(self.r).tolist()
......@@ -131,16 +131,16 @@ class TestDictFeature(GibbsTestCase):
def testWithDifferentVariables(self):
ie = gum.GibbsSampling(self.bn)
ie.setVerbosity(False)
ie.setEpsilon(0.0001)
ie.setMinEpsilonRate(0.0001)
ie.setEpsilon(0.01)
ie.setMinEpsilonRate(0.01)
ie.setEvidence({'r': [0, 1], 'w': (1, 0)})
ie.makeInference()
result = ie.posterior(self.s).tolist()
ie = gum.GibbsSampling(self.bni)
ie.setVerbosity(False)
ie.setEpsilon(0.0001)
ie.setMinEpsilonRate(0.0001)
ie.setEpsilon(0.01)
ie.setMinEpsilonRate(0.01)
ie.setEvidence({'ri': [0, 1], 'wi': (1, 0)})
ie.makeInference()
result2 = ie.posterior(self.si).tolist()
......@@ -148,8 +148,8 @@ class TestDictFeature(GibbsTestCase):
ie = gum.GibbsSampling(self.bn)
ie.setVerbosity(False)
ie.setEpsilon(0.0001)
ie.setMinEpsilonRate(0.0001)
ie.setEpsilon(0.01)
ie.setMinEpsilonRate(0.01)
ie.setEvidence({'r': 1, 'w': 0})
ie.makeInference()
result = ie.posterior(self.s).tolist()
......@@ -157,8 +157,8 @@ class TestDictFeature(GibbsTestCase):
ie = gum.GibbsSampling(self.bni)
ie.setVerbosity(False)
ie.setEpsilon(0.0001)
ie.setMinEpsilonRate(0.0001)
ie.setEpsilon(0.01)
ie.setMinEpsilonRate(0.01)
ie.setEvidence({'ri': "6", 'wi': "0.33"})
ie.makeInference()
result2 = ie.posterior(self.si).tolist()
......@@ -169,15 +169,15 @@ class TestInferenceResults(GibbsTestCase):
def testOpenBayesSiteExamples(self):
ie = gum.GibbsSampling(self.bn)
ie.setVerbosity(False)
ie.setEpsilon(0.0001)
ie.setMinEpsilonRate(0.0001)
ie.setEpsilon(0.01)
ie.setMinEpsilonRate(0.01)
result = ie.posterior(self.w)
self.assertDelta(result.tolist(), [0.3529, 0.6471])
ie = gum.GibbsSampling(self.bn)
ie.setVerbosity(False)
ie.setEpsilon(0.0001)
ie.setMinEpsilonRate(0.0001)
ie.setEpsilon(0.01)
ie.setMinEpsilonRate(0.01)
ie.setEvidence({'s': 1, 'c': 0})
ie.makeInference()
result = ie.posterior(self.w)
......@@ -186,8 +186,8 @@ class TestInferenceResults(GibbsTestCase):
def testWikipediaExample(self):
ie = gum.GibbsSampling(self.bn2)
ie.setVerbosity(False)
ie.setEpsilon(0.0001)
ie.setMinEpsilonRate(0.0001)
ie.setEpsilon(0.001)
ie.setMinEpsilonRate(0.001)
ie.setEvidence({'w2': 1})
ie.makeInference()
result = ie.posterior(self.r2)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment