Skip to content

Commit 262ec46

Browse files
committed
Modified the test
1 parent 5066e4f commit 262ec46

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

tests/estimation_tests/test_genetic_programming_regression_fitter.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55
from causal_testing.estimation.genetic_programming_regression_fitter import GP
66

77

8-
def root(x):
9-
return x**0.5
10-
11-
128
class TestGP(unittest.TestCase):
139
def test_init_invalid_fun_name(self):
1410
with self.assertRaises(ValueError):
@@ -34,10 +30,9 @@ def test_fitness_string(self):
3430

3531
def test_fitness_inf(self):
3632
gp = GP(
37-
df=pd.DataFrame({"x1": [-1], "outcome": [0]}),
33+
df=pd.DataFrame({"x1": [1, None], "outcome": [2, None]}),
3834
features=["x1"],
3935
outcome="outcome",
4036
max_order=0,
41-
extra_operators=[(root, 1)],
4237
)
43-
self.assertEquals(gp.fitness("root(x1)"), (float("inf"),))
38+
self.assertEquals(gp.fitness("add(x1, x1)"), (float("inf"),))

0 commit comments

Comments
 (0)