def setUp(self): self.data = PCAlg.prepare_data('data/asia_1000.data', ' ', True) self.pcalg = PCAlg(self.data, chi) self.fcialg = FCIAlg(self.data, chi) self.directed = nx.DiGraph() self.undirected = nx.Graph() self.directed.add_nodes_from([1, 2, 3, 4]) self.undirected.add_nodes_from(self.directed) self.pag = PAG() self.pag.add_nodes_from(self.undirected) self.sepset = {(x, y): [] for x in [1, 2, 3, 4, 5] for y in [1, 2, 3, 4, 5] if x != y}
def setUp(self): self.data = PCAlg.prepare_data('data/asia_1000.data', ' ', True) self.pcalg = PCAlg(self.data, chi) self.skeleton = nx.Graph()
def test13(self): self.data = PCAlg.prepare_data('data/insurance_1000.data', ' ', False) p, h = chi(self.data, '0', '1', ['2', '3']) assert (round(h, 3) == 35.531)
def test12(self): self.data = PCAlg.prepare_data('data/alarm_1000.data', ' ', False) p, h = chi(self.data, '1', '2', ['3', '4']) assert (round(h, 3) == 3.115)
def test11(self): self.data = PCAlg.prepare_data('data/asia_10000.data', ' ', True) p, h = chi(self.data, 'either', 'tub', ['bronc', 'xray']) assert (round(h, 3) == 9884.0)
def test9(self): self.data = PCAlg.prepare_data('data/asia_1000.data', ' ', True) p, h = chi(self.data, 'asia', 'tub', ['smoke', 'lung']) assert (round(h, 3) == 36.997)
def test7(self): self.data = PCAlg.prepare_data('data/asia_1000.data', ' ', True) p, h = chi(self.data, 'asia', 'tub', []) assert (round(h, 3) == 34.496)
def setUp(self): self.data = PCAlg.prepare_data('data/alarm_10000.dat', ' ', True)