Spaces:
Running
Running
AutonLabTruth
commited on
Commit
•
e2a7e95
1
Parent(s):
271a473
Added timing feature
Browse files- pysr/Problems.py +5 -1
pysr/Problems.py
CHANGED
@@ -93,9 +93,13 @@ def run_on_problem(problem, verbosity=0):
|
|
93 |
"""
|
94 |
Takes in a problem and returns a tuple: (equations, best predicted equation, actual equation)
|
95 |
"""
|
|
|
96 |
from . import pysr, best
|
|
|
97 |
equations = pysr(problem.X, problem.y, variable_names=problem.variable_names, verbosity=verbosity)
|
98 |
-
|
|
|
|
|
99 |
|
100 |
if __name__ == "__main__":
|
101 |
ret = FeynmanProblem.mk_problems(first=100, gen=True)
|
|
|
93 |
"""
|
94 |
Takes in a problem and returns a tuple: (equations, best predicted equation, actual equation)
|
95 |
"""
|
96 |
+
from time import time
|
97 |
from . import pysr, best
|
98 |
+
starting = time()
|
99 |
equations = pysr(problem.X, problem.y, variable_names=problem.variable_names, verbosity=verbosity)
|
100 |
+
timing = time()-starting
|
101 |
+
others = {"equations": equations, "time": timing}
|
102 |
+
return best(equations), problem.form, others
|
103 |
|
104 |
if __name__ == "__main__":
|
105 |
ret = FeynmanProblem.mk_problems(first=100, gen=True)
|