Spaces:
Running
Running
MilesCranmer
commited on
Commit
•
8c44280
1
Parent(s):
3483668
Update readme to Distributed.jl
Browse files
README.md
CHANGED
@@ -99,14 +99,14 @@ One can also edit `operators.jl`. See below for more options.
|
|
99 |
### Weighted data
|
100 |
|
101 |
Here, we assign weights to each row of data
|
102 |
-
using inverse uncertainty squared. We also use 10
|
103 |
instead of the usual 4, which creates more populations
|
104 |
(one population per thread).
|
105 |
```python
|
106 |
sigma = ...
|
107 |
weights = 1/sigma**2
|
108 |
|
109 |
-
equations = pysr.pysr(X, y, weights=weights,
|
110 |
```
|
111 |
|
112 |
|
@@ -160,7 +160,7 @@ name as a string.
|
|
160 |
What follows is the API reference for running the numpy interface.
|
161 |
You likely don't need to tune the hyperparameters yourself,
|
162 |
but if you would like, you can use `hyperopt.py` as an example.
|
163 |
-
However, you should adjust `
|
164 |
`binary_operators`, `unary_operators`, and `maxsize`
|
165 |
to your requirements.
|
166 |
|
@@ -171,22 +171,17 @@ which is `hall_of_fame.csv` by default. It also prints the
|
|
171 |
equations to stdout.
|
172 |
|
173 |
```python
|
174 |
-
pysr(X=None, y=None, weights=None,
|
175 |
```
|
176 |
|
177 |
Run symbolic regression to fit f(X[i, :]) ~ y[i] for all i.
|
178 |
-
Note: most default parameters have been tuned over several example
|
179 |
-
equations, but you should adjust `threads`, `niterations`,
|
180 |
-
`binary_operators`, `unary_operators` to your requirements.
|
181 |
|
182 |
**Arguments**:
|
183 |
|
184 |
- `X`: np.ndarray, 2D array. Rows are examples, columns are features.
|
185 |
- `y`: np.ndarray, 1D array. Rows are examples.
|
186 |
- `weights`: np.ndarray, 1D array. Same shape as `y`. Optional weighted sum (e.g., 1/error^2).
|
187 |
-
- `
|
188 |
-
You can have more threads than cores - it actually makes it more
|
189 |
-
efficient.
|
190 |
- `niterations`: int, Number of iterations of the algorithm to run. The best
|
191 |
equations are printed, and migrate between populations, at the
|
192 |
end of each.
|
|
|
99 |
### Weighted data
|
100 |
|
101 |
Here, we assign weights to each row of data
|
102 |
+
using inverse uncertainty squared. We also use 10 processes
|
103 |
instead of the usual 4, which creates more populations
|
104 |
(one population per thread).
|
105 |
```python
|
106 |
sigma = ...
|
107 |
weights = 1/sigma**2
|
108 |
|
109 |
+
equations = pysr.pysr(X, y, weights=weights, procs=10)
|
110 |
```
|
111 |
|
112 |
|
|
|
160 |
What follows is the API reference for running the numpy interface.
|
161 |
You likely don't need to tune the hyperparameters yourself,
|
162 |
but if you would like, you can use `hyperopt.py` as an example.
|
163 |
+
However, you should adjust `procs`, `niterations`,
|
164 |
`binary_operators`, `unary_operators`, and `maxsize`
|
165 |
to your requirements.
|
166 |
|
|
|
171 |
equations to stdout.
|
172 |
|
173 |
```python
|
174 |
+
pysr(X=None, y=None, weights=None, procs=4, niterations=100, ncyclesperiteration=300, binary_operators=["plus", "mult"], unary_operators=["cos", "exp", "sin"], alpha=0.1, annealing=True, fractionReplaced=0.10, fractionReplacedHof=0.10, npop=1000, parsimony=1e-4, migration=True, hofMigration=True, shouldOptimizeConstants=True, topn=10, weightAddNode=1, weightInsertNode=3, weightDeleteNode=3, weightDoNothing=1, weightMutateConstant=10, weightMutateOperator=1, weightRandomize=1, weightSimplify=0.01, perturbationFactor=1.0, nrestarts=3, timeout=None, equation_file='hall_of_fame.csv', test='simple1', verbosity=1e9, maxsize=20)
|
175 |
```
|
176 |
|
177 |
Run symbolic regression to fit f(X[i, :]) ~ y[i] for all i.
|
|
|
|
|
|
|
178 |
|
179 |
**Arguments**:
|
180 |
|
181 |
- `X`: np.ndarray, 2D array. Rows are examples, columns are features.
|
182 |
- `y`: np.ndarray, 1D array. Rows are examples.
|
183 |
- `weights`: np.ndarray, 1D array. Same shape as `y`. Optional weighted sum (e.g., 1/error^2).
|
184 |
+
- `procs`: int, Number of processes running (=number of populations running).
|
|
|
|
|
185 |
- `niterations`: int, Number of iterations of the algorithm to run. The best
|
186 |
equations are printed, and migrate between populations, at the
|
187 |
end of each.
|