def test_estimate(self): data = pd.DataFrame(np.random.randint(0, 3, size=(1000, 3)), columns=list('XYZ')) data['sum'] = data.sum(axis=1) model = ConstraintBasedEstimator(data).estimate() self.assertSetEqual(set(model.edges()), set([('Z', 'sum'), ('X', 'sum'), ('Y', 'sum')]))
def test_estimate(self): data = pd.DataFrame(np.random.randint(0, 3, size=(1000, 3)), columns=list("XYZ")) data["sum"] = data.sum(axis=1) model = ConstraintBasedEstimator(data).estimate() self.assertSetEqual(set(model.edges()), set([("Z", "sum"), ("X", "sum"), ("Y", "sum")]))