Spaces:
Sleeping
Sleeping
Commit
·
b77101f
1
Parent(s):
1998ae8
Make multithreading the default mode
Browse files- pysr/sr.py +1 -1
- setup.py +1 -1
- test/test.py +2 -2
pysr/sr.py
CHANGED
|
@@ -133,7 +133,7 @@ def pysr(
|
|
| 133 |
denoise=False,
|
| 134 |
Xresampled=None,
|
| 135 |
precision=32,
|
| 136 |
-
multithreading=
|
| 137 |
):
|
| 138 |
"""Run symbolic regression to fit f(X[i, :]) ~ y[i] for all i.
|
| 139 |
Note: most default parameters have been tuned over several example
|
|
|
|
| 133 |
denoise=False,
|
| 134 |
Xresampled=None,
|
| 135 |
precision=32,
|
| 136 |
+
multithreading=True,
|
| 137 |
):
|
| 138 |
"""Run symbolic regression to fit f(X[i, :]) ~ y[i] for all i.
|
| 139 |
Note: most default parameters have been tuned over several example
|
setup.py
CHANGED
|
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
|
|
| 5 |
|
| 6 |
setuptools.setup(
|
| 7 |
name="pysr",
|
| 8 |
-
version="0.6.
|
| 9 |
author="Miles Cranmer",
|
| 10 |
author_email="miles.cranmer@gmail.com",
|
| 11 |
description="Simple and efficient symbolic regression",
|
|
|
|
| 5 |
|
| 6 |
setuptools.setup(
|
| 7 |
name="pysr",
|
| 8 |
+
version="0.6.14",
|
| 9 |
author="Miles Cranmer",
|
| 10 |
author_email="miles.cranmer@gmail.com",
|
| 11 |
description="Simple and efficient symbolic regression",
|
test/test.py
CHANGED
|
@@ -26,10 +26,10 @@ class TestPipeline(unittest.TestCase):
|
|
| 26 |
print(equations)
|
| 27 |
self.assertLessEqual(equations.iloc[-1]["MSE"], 1e-4)
|
| 28 |
|
| 29 |
-
def
|
| 30 |
y = self.X[:, 0]
|
| 31 |
equations = pysr(
|
| 32 |
-
self.X, y, **self.default_test_kwargs, procs=2, multithreading=
|
| 33 |
)
|
| 34 |
print(equations)
|
| 35 |
self.assertLessEqual(equations.iloc[-1]["MSE"], 1e-4)
|
|
|
|
| 26 |
print(equations)
|
| 27 |
self.assertLessEqual(equations.iloc[-1]["MSE"], 1e-4)
|
| 28 |
|
| 29 |
+
def test_multiprocessing(self):
|
| 30 |
y = self.X[:, 0]
|
| 31 |
equations = pysr(
|
| 32 |
+
self.X, y, **self.default_test_kwargs, procs=2, multithreading=False
|
| 33 |
)
|
| 34 |
print(equations)
|
| 35 |
self.assertLessEqual(equations.iloc[-1]["MSE"], 1e-4)
|