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])
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])
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])
def test_marginal_ve_e_prior1(self): self.assertListEqual(list(marginal_ve_e(self.bn, 'Burglary')), self.bn.cpt('Burglary'))
def test_marginal_ve_e_prior2(self): self.assertListEqual(list(marginal_ve_e(self.bn, 'Earthquake')), self.bn.cpt('Earthquake'))
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])
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])
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])
def test_marginal_ve_e_prior2(self): self.assertListEqual(list(marginal_ve_e(self.bn,'Earthquake')), self.bn.cpt('Earthquake'))
def test_marginal_ve_e_prior1(self): self.assertListEqual(list(marginal_ve_e(self.bn,'Burglary')), self.bn.cpt('Burglary'))