Spaces:
Sleeping
Sleeping
MilesCranmer
commited on
Commit
•
3663ed6
1
Parent(s):
1a8a8f0
Make sure test doesnt need user input
Browse files- .travis.yml +0 -28
- test/test.py +6 -3
.travis.yml
DELETED
@@ -1,28 +0,0 @@
|
|
1 |
-
language: julia
|
2 |
-
julia:
|
3 |
-
- 1
|
4 |
-
|
5 |
-
jobs:
|
6 |
-
include:
|
7 |
-
- name: "Linux"
|
8 |
-
os: linux
|
9 |
-
dist: bionic
|
10 |
-
before_install: sudo apt-get -y install python3-pip python3-setuptools
|
11 |
-
env: PY=python3 SETUPPREFIX="--user"
|
12 |
-
- name: "Windows"
|
13 |
-
os: windows
|
14 |
-
before_install:
|
15 |
-
- choco install python --version 3.8.0
|
16 |
-
- python -m pip install --upgrade pip
|
17 |
-
env: PATH=/c/Python38:/c/Python38/Scripts:$PATH PY=python
|
18 |
-
|
19 |
-
install: pip3 install --upgrade pip
|
20 |
-
|
21 |
-
before_script:
|
22 |
-
- julia --color=yes -e 'using Pkg; pkg"add SymbolicRegression; precompile;"'
|
23 |
-
|
24 |
-
script:
|
25 |
-
- pip3 install numpy pandas
|
26 |
-
- $PY setup.py install $SETUPPREFIX
|
27 |
-
- PATH=$HOME/.local/bin:$PATH $PY test/test.py
|
28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
test/test.py
CHANGED
@@ -5,7 +5,8 @@ X = np.random.randn(100, 5)
|
|
5 |
print("Test 1 - defaults; simple linear relation")
|
6 |
y = X[:, 0]
|
7 |
equations = pysr(X, y,
|
8 |
-
niterations=10
|
|
|
9 |
print(equations)
|
10 |
assert equations.iloc[-1]['MSE'] < 1e-4
|
11 |
|
@@ -14,7 +15,8 @@ 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-4
|
20 |
|
@@ -23,7 +25,8 @@ y = X[:, 0] + 3.0
|
|
23 |
print("Test 3 - empty operator list, and single dimension input")
|
24 |
equations = pysr(X, y,
|
25 |
unary_operators=[], binary_operators=["plus"],
|
26 |
-
niterations=10
|
|
|
27 |
|
28 |
print(equations)
|
29 |
assert equations.iloc[-1]['MSE'] < 1e-4
|
|
|
5 |
print("Test 1 - defaults; simple linear relation")
|
6 |
y = X[:, 0]
|
7 |
equations = pysr(X, y,
|
8 |
+
niterations=10,
|
9 |
+
user_input=False)
|
10 |
print(equations)
|
11 |
assert equations.iloc[-1]['MSE'] < 1e-4
|
12 |
|
|
|
15 |
equations = pysr(X, y,
|
16 |
unary_operators=["sq(x) = x^2"], binary_operators=["plus"],
|
17 |
extra_sympy_mappings={'square': lambda x: x**2},
|
18 |
+
niterations=10,
|
19 |
+
user_input=False)
|
20 |
print(equations)
|
21 |
assert equations.iloc[-1]['MSE'] < 1e-4
|
22 |
|
|
|
25 |
print("Test 3 - empty operator list, and single dimension input")
|
26 |
equations = pysr(X, y,
|
27 |
unary_operators=[], binary_operators=["plus"],
|
28 |
+
niterations=10,
|
29 |
+
user_input=False)
|
30 |
|
31 |
print(equations)
|
32 |
assert equations.iloc[-1]['MSE'] < 1e-4
|