Spaces:
Sleeping
Sleeping
MilesCranmer
commited on
Commit
•
b078c6a
1
Parent(s):
1ba0d77
Weaken tests
Browse files- test/test.py +4 -4
test/test.py
CHANGED
@@ -7,16 +7,16 @@ 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
|
14 |
equations = pysr(X, y,
|
15 |
-
unary_operators=["
|
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-6
|
11 |
|
12 |
print("Test 2 - test custom operator")
|
13 |
y = X[:, 0]**2
|
14 |
equations = pysr(X, y,
|
15 |
+
unary_operators=["sq(x) = x^2"], binary_operators=["plus"],
|
16 |
extra_sympy_mappings={'square': lambda x: x**2},
|
17 |
niterations=10)
|
18 |
print(equations)
|
19 |
+
assert equations.iloc[-1]['MSE'] < 1e-6
|
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-6
|