예제 #1
0
 def test_marginal_ve_e_middle_prior_ev(self):
     self.assertListEqual(
         list(marginal_ve_e(self.bn, 'Alarm',
                            evidence={'Burglary': 'Yes'})), [0.06, 0.94])
예제 #2
0
 def test_marginal_ve_e_prior_middle_ev(self):
     self.assertListEqual(
         list(marginal_ve_e(self.bn, 'Burglary',
                            evidence={'Alarm': 'Yes'})), [0.62963, 0.37037])
예제 #3
0
 def test_marginal_ve_e_prior_leaf_ev(self):
     self.assertListEqual(
         list(
             marginal_ve_e(self.bn,
                           'Burglary',
                           evidence={'JohnCalls': 'Yes'})), [0.999, 0.001])
예제 #4
0
 def test_marginal_ve_e_prior1(self):
     self.assertListEqual(list(marginal_ve_e(self.bn, 'Burglary')),
                          self.bn.cpt('Burglary'))
예제 #5
0
 def test_marginal_ve_e_prior2(self):
     self.assertListEqual(list(marginal_ve_e(self.bn, 'Earthquake')),
                          self.bn.cpt('Earthquake'))
예제 #6
0
	def test_marginal_ve_e_middle_prior_ev(self):
		self.assertListEqual(list(marginal_ve_e(self.bn,'Alarm',
			evidence={'Burglary':'Yes'})),[0.06,0.94])
예제 #7
0
	def test_marginal_ve_e_prior_leaf_ev(self):
		self.assertListEqual(list(marginal_ve_e(self.bn,'Burglary',
			evidence={'JohnCalls':'Yes'})),[ 0.999,  0.001])
예제 #8
0
	def test_marginal_ve_e_prior_middle_ev(self):
		self.assertListEqual(list(marginal_ve_e(self.bn,'Burglary',
			evidence={'Alarm':'Yes'})),[ 0.62963,  0.37037])
예제 #9
0
	def test_marginal_ve_e_prior2(self):
		self.assertListEqual(list(marginal_ve_e(self.bn,'Earthquake')),
			self.bn.cpt('Earthquake'))
예제 #10
0
	def test_marginal_ve_e_prior1(self):
		self.assertListEqual(list(marginal_ve_e(self.bn,'Burglary')),
			self.bn.cpt('Burglary'))