Spaces:
Running
Running
MilesCranmer
commited on
Commit
•
f755fc9
1
Parent(s):
a69a9d7
Fix examples formatting
Browse files- docs/examples.md +6 -5
docs/examples.md
CHANGED
@@ -15,7 +15,7 @@ for more complex searches).
|
|
15 |
kwargs = dict(populations=5, niterations=5, annealing=True)
|
16 |
```
|
17 |
|
18 |
-
1. Simple search
|
19 |
|
20 |
Here's a simple example where we turn off multiprocessing,
|
21 |
and find the expression `2 cos(x3) + x0^2 - 2`.
|
@@ -27,7 +27,7 @@ expressions = pysr(X, y, binary_operators=["+", "-", "*", "/"], **kwargs)
|
|
27 |
print(best(expressions))
|
28 |
```
|
29 |
|
30 |
-
2. Custom operator
|
31 |
|
32 |
Here, we define a custom operator and use it to find an expression:
|
33 |
|
@@ -44,7 +44,7 @@ expressions = pysr(
|
|
44 |
print(best(expressions))
|
45 |
```
|
46 |
|
47 |
-
3. Multiple outputs
|
48 |
|
49 |
Here, we do the same thing, but with multiple expressions at once,
|
50 |
each requiring a different feature.
|
@@ -60,7 +60,7 @@ expressions = pysr(
|
|
60 |
)
|
61 |
```
|
62 |
|
63 |
-
4. Plotting an expression
|
64 |
|
65 |
Here, let's use the same equations, but get a format we can actually
|
66 |
use and test. We can add this option after a search via the `get_hof`
|
@@ -106,4 +106,5 @@ plt.ylabel('Prediction')
|
|
106 |
plt.show()
|
107 |
```
|
108 |
Which gives us:
|
109 |
-
|
|
|
|
15 |
kwargs = dict(populations=5, niterations=5, annealing=True)
|
16 |
```
|
17 |
|
18 |
+
## 1. Simple search
|
19 |
|
20 |
Here's a simple example where we turn off multiprocessing,
|
21 |
and find the expression `2 cos(x3) + x0^2 - 2`.
|
|
|
27 |
print(best(expressions))
|
28 |
```
|
29 |
|
30 |
+
## 2. Custom operator
|
31 |
|
32 |
Here, we define a custom operator and use it to find an expression:
|
33 |
|
|
|
44 |
print(best(expressions))
|
45 |
```
|
46 |
|
47 |
+
## 3. Multiple outputs
|
48 |
|
49 |
Here, we do the same thing, but with multiple expressions at once,
|
50 |
each requiring a different feature.
|
|
|
60 |
)
|
61 |
```
|
62 |
|
63 |
+
## 4. Plotting an expression
|
64 |
|
65 |
Here, let's use the same equations, but get a format we can actually
|
66 |
use and test. We can add this option after a search via the `get_hof`
|
|
|
106 |
plt.show()
|
107 |
```
|
108 |
Which gives us:
|
109 |
+
|
110 |
+
![](https://github.com/MilesCranmer/PySR/raw/master/docs/images/example_plot.png)
|