Spaces:
Running
Running
Fix operators in colab demo
Browse files- examples/pysr_demo.ipynb +4 -4
examples/pysr_demo.ipynb
CHANGED
|
@@ -231,7 +231,7 @@
|
|
| 231 |
"# Learn equations\n",
|
| 232 |
"model = PySRRegressor(\n",
|
| 233 |
" niterations=30,\n",
|
| 234 |
-
" binary_operators=[\"+\", \"
|
| 235 |
" unary_operators=[\"cos\", \"exp\", \"sin\"],\n",
|
| 236 |
" **default_pysr_params\n",
|
| 237 |
")\n",
|
|
@@ -439,7 +439,7 @@
|
|
| 439 |
"model = PySRRegressor(\n",
|
| 440 |
" niterations=5,\n",
|
| 441 |
" populations=40,\n",
|
| 442 |
-
" binary_operators=[\"+\", \"
|
| 443 |
" unary_operators=[\"cos\", \"exp\", \"sin\", \"quart(x) = x^4\"],\n",
|
| 444 |
" extra_sympy_mappings={\"quart\": lambda x: x**4},\n",
|
| 445 |
")\n",
|
|
@@ -651,7 +651,7 @@
|
|
| 651 |
" loss=\"myloss(x, y, w) = w * abs(x - y)\", # Custom loss function with weights.\n",
|
| 652 |
" niterations=20,\n",
|
| 653 |
" populations=20, # Use more populations\n",
|
| 654 |
-
" binary_operators=[\"+\", \"
|
| 655 |
" unary_operators=[\"cos\"],\n",
|
| 656 |
")\n",
|
| 657 |
"model.fit(X, y, weights=weights)"
|
|
@@ -833,7 +833,7 @@
|
|
| 833 |
"import pysr\n",
|
| 834 |
"\n",
|
| 835 |
"jl = pysr.julia_helpers.init_julia(\n",
|
| 836 |
-
" julia_kwargs=dict(optimize=3, threads=\"auto\", compiled_modules
|
| 837 |
")"
|
| 838 |
]
|
| 839 |
},
|
|
|
|
| 231 |
"# Learn equations\n",
|
| 232 |
"model = PySRRegressor(\n",
|
| 233 |
" niterations=30,\n",
|
| 234 |
+
" binary_operators=[\"+\", \"*\"],\n",
|
| 235 |
" unary_operators=[\"cos\", \"exp\", \"sin\"],\n",
|
| 236 |
" **default_pysr_params\n",
|
| 237 |
")\n",
|
|
|
|
| 439 |
"model = PySRRegressor(\n",
|
| 440 |
" niterations=5,\n",
|
| 441 |
" populations=40,\n",
|
| 442 |
+
" binary_operators=[\"+\", \"*\"],\n",
|
| 443 |
" unary_operators=[\"cos\", \"exp\", \"sin\", \"quart(x) = x^4\"],\n",
|
| 444 |
" extra_sympy_mappings={\"quart\": lambda x: x**4},\n",
|
| 445 |
")\n",
|
|
|
|
| 651 |
" loss=\"myloss(x, y, w) = w * abs(x - y)\", # Custom loss function with weights.\n",
|
| 652 |
" niterations=20,\n",
|
| 653 |
" populations=20, # Use more populations\n",
|
| 654 |
+
" binary_operators=[\"+\", \"*\"],\n",
|
| 655 |
" unary_operators=[\"cos\"],\n",
|
| 656 |
")\n",
|
| 657 |
"model.fit(X, y, weights=weights)"
|
|
|
|
| 833 |
"import pysr\n",
|
| 834 |
"\n",
|
| 835 |
"jl = pysr.julia_helpers.init_julia(\n",
|
| 836 |
+
" julia_kwargs=dict(optimize=3, threads=\"auto\", compiled_modules=False)\n",
|
| 837 |
")"
|
| 838 |
]
|
| 839 |
},
|