File size: 1,231 Bytes
c8d959a
 
 
 
 
 
 
 
e8f42f8
 
 
319103f
 
1c63c5c
c8d959a
1c63c5c
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
python setup.py install > /dev/null && python -c '
import pkg_resources
version = pkg_resources.get_distribution("pysr").version
version = [int(elem) for elem in version.split(".")]
import numpy as np
from pysr import pysr
X=np.random.randn(100, 2)*5
y=2*np.sin((X[:, 0]+X[:, 1]))*np.exp(X[:, 1]/3)
if version[1] >= 3 and version[2] >= 17:
    eq = pysr(X, y, binary_operators=["plus", "mult", "div", "pow"], unary_operators=["sin"], niterations=20, procs=4, parsimony=1e-10, npop=1000, ncyclesperiteration=1000, maxdepth=6, fast_cycle=True)
elif version[1] >= 3 and version[2] >= 16:
    eq = pysr(X, y, binary_operators=["plus", "mult", "div", "pow"], unary_operators=["sin"], niterations=20, procs=4, parsimony=1e-10, npop=1000, ncyclesperiteration=1000, maxdepth=6)
elif version[1] >= 3 and version[2] >= 2:
    eq = pysr(X, y, binary_operators=["plus", "mult", "div", "pow"], unary_operators=["sin"], niterations=20, procs=4, parsimony=1e-10, npop=1000, ncyclesperiteration=1000)
else:
    eq = pysr(X, y, binary_operators=["plus", "mult", "div", "pow"], unary_operators=["sin"], niterations=20, threads=4, parsimony=1e-10, npop=1000, ncyclesperiteration=1000)
' 2>&1 | grep 'per second' | tail -n 1 | vims '%s/ //g' -l 'df:'