Spaces:
Sleeping
Sleeping
Commit
·
b16d9ef
1
Parent(s):
dde0ef7
Automatically pickle file at initialization
Browse files- pysr/sr.py +5 -0
pysr/sr.py
CHANGED
|
@@ -1623,6 +1623,11 @@ class PySRRegressor(MultiOutputMixin, RegressorMixin, BaseEstimator):
|
|
| 1623 |
y,
|
| 1624 |
)
|
| 1625 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1626 |
# Fitting procedure
|
| 1627 |
return self._run(X, y, mutated_params, weights=weights, seed=seed)
|
| 1628 |
|
|
|
|
| 1623 |
y,
|
| 1624 |
)
|
| 1625 |
|
| 1626 |
+
# Save model state:
|
| 1627 |
+
self.show_pickle_warnings_ = False
|
| 1628 |
+
with open(str(self.equation_file_) + ".pkl", "wb") as f:
|
| 1629 |
+
pkl.dump(self, f)
|
| 1630 |
+
self.show_pickle_warnings_ = True
|
| 1631 |
# Fitting procedure
|
| 1632 |
return self._run(X, y, mutated_params, weights=weights, seed=seed)
|
| 1633 |
|