Spaces:
Sleeping
Sleeping
Commit
·
022de02
1
Parent(s):
d31f4fe
Make unit tests easier
Browse files- test/test.py +3 -3
test/test.py
CHANGED
|
@@ -7,7 +7,7 @@ y = X[:, 0]
|
|
| 7 |
equations = pysr(X, y,
|
| 8 |
niterations=10)
|
| 9 |
print(equations)
|
| 10 |
-
assert equations.iloc[-1]['MSE'] < 1e-
|
| 11 |
|
| 12 |
print("Test 2 - test custom operator")
|
| 13 |
y = X[:, 0]**2
|
|
@@ -16,7 +16,7 @@ equations = pysr(X, y,
|
|
| 16 |
extra_sympy_mappings={'square': lambda x: x**2},
|
| 17 |
niterations=10)
|
| 18 |
print(equations)
|
| 19 |
-
assert equations.iloc[-1]['MSE'] < 1e-
|
| 20 |
|
| 21 |
X = np.random.randn(100, 1)
|
| 22 |
y = X[:, 0] + 3.0
|
|
@@ -26,4 +26,4 @@ equations = pysr(X, y,
|
|
| 26 |
niterations=10)
|
| 27 |
|
| 28 |
print(equations)
|
| 29 |
-
assert equations.iloc[-1]['MSE'] < 1e-
|
|
|
|
| 7 |
equations = pysr(X, y,
|
| 8 |
niterations=10)
|
| 9 |
print(equations)
|
| 10 |
+
assert equations.iloc[-1]['MSE'] < 1e-4
|
| 11 |
|
| 12 |
print("Test 2 - test custom operator")
|
| 13 |
y = X[:, 0]**2
|
|
|
|
| 16 |
extra_sympy_mappings={'square': lambda x: x**2},
|
| 17 |
niterations=10)
|
| 18 |
print(equations)
|
| 19 |
+
assert equations.iloc[-1]['MSE'] < 1e-4
|
| 20 |
|
| 21 |
X = np.random.randn(100, 1)
|
| 22 |
y = X[:, 0] + 3.0
|
|
|
|
| 26 |
niterations=10)
|
| 27 |
|
| 28 |
print(equations)
|
| 29 |
+
assert equations.iloc[-1]['MSE'] < 1e-4
|