Spaces:
Running
Running
MilesCranmer
commited on
Commit
•
038eaaf
1
Parent(s):
009d206
Add test for DaemonMode
Browse files- test/test.py +15 -12
test/test.py
CHANGED
@@ -69,18 +69,21 @@ class TestPipeline(unittest.TestCase):
|
|
69 |
best_callable()[1](self.X), self.X[:, 1] ** 2, decimal=4
|
70 |
)
|
71 |
|
72 |
-
def
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
X
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
|
|
|
|
|
|
84 |
|
85 |
def test_noisy(self):
|
86 |
|
|
|
69 |
best_callable()[1](self.X), self.X[:, 1] ** 2, decimal=4
|
70 |
)
|
71 |
|
72 |
+
def test_empty_operators_single_input_daemon(self):
|
73 |
+
for i in range(2):
|
74 |
+
np.random.seed(i)
|
75 |
+
X = np.random.randn(100, 1)
|
76 |
+
y = X[:, 0] + 3.0
|
77 |
+
equations = pysr(
|
78 |
+
X,
|
79 |
+
y,
|
80 |
+
unary_operators=[],
|
81 |
+
binary_operators=["plus"],
|
82 |
+
**self.default_test_kwargs,
|
83 |
+
daemon_mode=True,
|
84 |
+
)
|
85 |
+
|
86 |
+
self.assertLessEqual(equations.iloc[-1]["MSE"], 1e-4)
|
87 |
|
88 |
def test_noisy(self):
|
89 |
|