MilesCranmer commited on
Commit
3c8d9b9
1 Parent(s): 2b25b44

Remove remaining uses of .equation in docs

Browse files
Files changed (2) hide show
  1. README.md +2 -2
  2. pysr/sr.py +3 -3
README.md CHANGED
@@ -119,7 +119,7 @@ print(model)
119
  ```
120
  to print the learned equations:
121
  ```python
122
- PySRRegressor.equations = [
123
  pick score equation loss complexity
124
  0 0.000000 4.4324794 42.354317 1
125
  1 1.255691 (x0 * x0) 3.437307 3
@@ -133,7 +133,7 @@ This arrow in the `pick` column indicates which equation is currently selected b
133
  `model_selection` strategy for prediction.
134
  (You may change `model_selection` after `.fit(X, y)` as well.)
135
 
136
- `model.equations` is a pandas DataFrame containing all equations, including callable format
137
  (`lambda_format`),
138
  SymPy format (`sympy_format` - which you can also get with `model.sympy()`), and even JAX and PyTorch format
139
  (both of which are differentiable - which you can get with `model.jax()` and `model.pytorch()`).
 
119
  ```
120
  to print the learned equations:
121
  ```python
122
+ PySRRegressor.equations_ = [
123
  pick score equation loss complexity
124
  0 0.000000 4.4324794 42.354317 1
125
  1 1.255691 (x0 * x0) 3.437307 3
 
133
  `model_selection` strategy for prediction.
134
  (You may change `model_selection` after `.fit(X, y)` as well.)
135
 
136
+ `model.equations_` is a pandas DataFrame containing all equations, including callable format
137
  (`lambda_format`),
138
  SymPy format (`sympy_format` - which you can also get with `model.sympy()`), and even JAX and PyTorch format
139
  (both of which are differentiable - which you can get with `model.jax()` and `model.pytorch()`).
pysr/sr.py CHANGED
@@ -82,7 +82,7 @@ def pysr(X, y, weights=None, **kwargs): # pragma: no cover
82
  )
83
  model = PySRRegressor(**kwargs)
84
  model.fit(X, y, weights=weights)
85
- return model.equations
86
 
87
 
88
  def _process_constraints(binary_operators, unary_operators, constraints):
@@ -167,7 +167,7 @@ def best_row(*args, **kwargs): # pragma: no cover
167
  raise NotImplementedError(
168
  "`best_row` has been deprecated. Please use the `PySRRegressor` interface. "
169
  "After fitting, you can run `print(model)` to view the best equation, or "
170
- "`model.get_best()` to return the best equation's row in `model.equations`."
171
  )
172
 
173
 
@@ -589,7 +589,7 @@ class PySRRegressor(MultiOutputMixin, RegressorMixin, BaseEstimator):
589
  ... )
590
  >>> model.fit(X, y)
591
  >>> model
592
- PySRRegressor.equations = [
593
  0 0.000000 3.8552167 3.360272e+01 1
594
  1 1.189847 (x0 * x0) 3.110905e+00 3
595
  2 0.010626 ((x0 * x0) + -0.25573406) 3.045491e+00 5
 
82
  )
83
  model = PySRRegressor(**kwargs)
84
  model.fit(X, y, weights=weights)
85
+ return model.equations_
86
 
87
 
88
  def _process_constraints(binary_operators, unary_operators, constraints):
 
167
  raise NotImplementedError(
168
  "`best_row` has been deprecated. Please use the `PySRRegressor` interface. "
169
  "After fitting, you can run `print(model)` to view the best equation, or "
170
+ "`model.get_best()` to return the best equation's row in `model.equations_`."
171
  )
172
 
173
 
 
589
  ... )
590
  >>> model.fit(X, y)
591
  >>> model
592
+ PySRRegressor.equations_ = [
593
  0 0.000000 3.8552167 3.360272e+01 1
594
  1 1.189847 (x0 * x0) 3.110905e+00 3
595
  2 0.010626 ((x0 * x0) + -0.25573406) 3.045491e+00 5