def test_gs_data(self): d = np.loadtxt(os.path.join(self.dpath, 'gs_data.txt'), dtype='int32') bn = gs(d) self.assertDictEqual(bn.E, { 0: [], 1: [], 2: [0, 1, 4, 3], 3: [], 4: [] })
def test_gs1_F(self): bn = gs(self.data) self.assertDictEqual( bn.F, { 0: { 'cpt': [], 'parents': [], 'values': [1, 2] }, 1: { 'cpt': [], 'parents': [0], 'values': [1, 2] }, 2: { 'cpt': [], 'parents': [0], 'values': [1, 2] } })
def test_gs1_E(self): bn = gs(self.data) self.assertDictEqual(bn.E, {0: [1, 2], 1: [], 2: []})
def test_gs1_V(self): bn = gs(self.data) self.assertListEqual(bn.V, [0, 1, 2])
def test_gs_data(self): d = np.loadtxt(os.path.join(self.dpath,'gs_data.txt'),dtype='int32') bn = gs(d) self.assertDictEqual(bn.E, {0: [], 1: [], 2: [0, 1, 4, 3], 3: [], 4: []})
def test_gs1_F(self): bn = gs(self.data) self.assertDictEqual(bn.F, {0: {'cpt': [], 'parents': [], 'values': [1,2]}, 1: {'cpt': [], 'parents': [0], 'values': [1,2]}, 2: {'cpt': [], 'parents': [0], 'values': [1,2]}})
def test_gs1_E(self): bn = gs(self.data) self.assertDictEqual(bn.E, {0:[1,2],1:[],2:[]})
def test_gs1_V(self): bn = gs(self.data) self.assertListEqual(bn.V, [0,1,2])