Exemple #1
0
 def test_bayes_update_nondiscriminating(self):
     """bayes_updates should be unaffected by extra nondiscriminating data"""
     # deletion of non-discriminating evidence should not affect result
     for obs, exp in zip(bayes_updates(self.deleted), self.result):
         self.assertFloatEqualAbs(obs, exp, 1e-11)
     # additional non-discriminating evidence should not affect result
     for obs, exp in zip(bayes_updates(self.extra), self.result):
         self.assertFloatEqualAbs(obs, exp, 1e-11)
Exemple #2
0
 def test_bayes_updates_permuted(self):
     """bayes_updates should not be affected by order of inputs"""
     for obs, exp in zip(bayes_updates(self.permuted), self.result):
         self.assertFloatEqualAbs(obs, exp, 1e-11)
Exemple #3
0
 def test_bayes_updates_good_data(self):
     """bayes_updates should match hand calculations of probability updates"""
     # result for first -> fourth calculated by hand
     for obs, exp in zip(bayes_updates(self.test), self.result):
         self.assertFloatEqualAbs(obs, exp, 1e-11)