Spaces:
Running
Running
MilesCranmer
commited on
Commit
•
9433a83
1
Parent(s):
f5a5c8e
Add README example for from_file
Browse files
README.md
CHANGED
@@ -162,7 +162,15 @@ This arrow in the `pick` column indicates which equation is currently selected b
|
|
162 |
SymPy format (`sympy_format` - which you can also get with `model.sympy()`), and even JAX and PyTorch format
|
163 |
(both of which are differentiable - which you can get with `model.jax()` and `model.pytorch()`).
|
164 |
|
165 |
-
Note that `PySRRegressor` stores the state of the last search, and will restart from where you left off the next time you call `.fit()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
166 |
|
167 |
There are several other useful features such as denoising (e.g., `denoising=True`),
|
168 |
feature selection (e.g., `select_k_features=3`).
|
|
|
162 |
SymPy format (`sympy_format` - which you can also get with `model.sympy()`), and even JAX and PyTorch format
|
163 |
(both of which are differentiable - which you can get with `model.jax()` and `model.pytorch()`).
|
164 |
|
165 |
+
Note that `PySRRegressor` stores the state of the last search, and will restart from where you left off the next time you call `.fit()`, assuming you have set `warm_start=True`.
|
166 |
+
This will cause problems if significant changes are made to the search parameters (like changing the operators). You can run `model.reset()` to reset the state.
|
167 |
+
|
168 |
+
You will notice that PySR will save two files: `hall_of_fame...csv` and `hall_of_fame...pkl`.
|
169 |
+
The csv file is a list of equations and their losses, and the pkl file is a saved state of the model.
|
170 |
+
You may load the model from the `pkl` file with:
|
171 |
+
```python
|
172 |
+
model = PySRRegressor.from_file("hall_of_fame.2022-08-10_100832.281.pkl")
|
173 |
+
```
|
174 |
|
175 |
There are several other useful features such as denoising (e.g., `denoising=True`),
|
176 |
feature selection (e.g., `select_k_features=3`).
|