Spaces:
Running
Running
Commit ·
1bd0408
1
Parent(s): eb2dca9
Rename example file so it is obviously an example
Browse filesFiles changed (2)
- README.md+2-7
- main.py → example.pyRenamed+6-8
64 unmodified lines6566676869707172737475767778798064 unmodified lines```# QuickstartFor a simple demo, start by navigating to the root directory and then in a terminal call```>> python main.py```<br>For a more hands on demo you can do the following (also in the root directory)```pythonimport numpy as npfrom pysr import pysr, best, get_hof# DatasetX = 2*np.random.randn(100, 5)64 unmodified lines656667686970717273747564 unmodified lines```# QuickstartHere is some demo code (also found in `example.py`)```pythonimport numpy as npfrom pysr import pysr, best# DatasetX = 2*np.random.randn(100, 5)
12345678910111213141516171819import numpy as npfrom pysr import pysr, best, get_hofimport time# DatasetX = 2*np.random.randn(100, 5)y = 2*np.cos(X[:, 3]) + X[:, 0]**2 - 2# Learn equationsstart = time.time()equations = pysr(X, y, niterations=5,binary_operators=["plus", "mult"],unary_operators=["cos", "exp", "sin"])... # (you can use ctl-c to exit early)print(best(equations))print(f"Took {time.time()-start} seconds")1234567891011121314151617import numpy as npfrom pysr import pysr, best# DatasetX = 2*np.random.randn(100, 5)y = 2*np.cos(X[:, 3]) + X[:, 0]**2 - 2# Learn equationsequations = pysr(X, y, niterations=5,binary_operators=["plus", "mult"],unary_operators=["cos", "exp", "sin", #Pre-defined library of operators (see https://pysr.readthedocs.io/en/latest/docs/operators/)"inv(x) = 1/x"]) # Define your own operator! (Julia syntax)...# (you can use ctl-c to exit early)print(best(equations))
README.md+2-7
main.py → example.pyRenamed+6-8