def test_compute_f(self):
    tree = DomainTree(domains=self.d0, min_split=0.5)
    with self.assertRaises(NodeNotFoundException):
        tree.node_which_contains({'x0': (- 12)})
    x = {'x0': 0}
    node = tree.node_which_contains(x)
    self.assertIsNotNone(node.regression)
    b = node.regression.coef_[0]
    c = node.regression.intercept_
    self.assertEqual(node.regression.predict([list(x.values())]), ((b * x[list(x.keys())[0]]) + c))
    self.assertEqual(tree.compute_f(x), node.regression.predict([list(x.values())]))
def test_compute_f(self):
    tree = DomainTree(domains=self.d0, min_split=0.5)
    with self.assertRaises(NodeNotFoundException):
        tree.node_which_contains({'x0': (- 12)})
    x = {'x0': 0}
    node = tree.node_which_contains(x)
    self.assertIsNotNone(node.regression)
    b = node.regression.coef_[0]
    c = node.regression.intercept_
    self.assertEqual(node.regression.predict([list(x.values())]), ((b * x[list(x.keys())[0]]) + c))
    self.assertEqual(tree.compute_f(x), node.regression.predict([list(x.values())]))