Skip to content

Commit

Permalink
Update example with new interface
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesCranmer committed Oct 23, 2022
1 parent bd4374d commit 05c6137
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
7 changes: 5 additions & 2 deletions README.md
Expand Up @@ -33,7 +33,7 @@ a 2D array (shape [features, rows]) and attempts
to model a 1D array (shape [rows])
using analytic functional forms.

Run distributed on four processes with:
Run with:
```julia
using SymbolicRegression

Expand All @@ -46,7 +46,10 @@ options = SymbolicRegression.Options(
npopulations=20
)

hall_of_fame = EquationSearch(X, y, niterations=40, options=options, numprocs=4)
hall_of_fame = EquationSearch(
X, y, niterations=40, options=options,
parallelism=:multithreading
)
```
You can view the resultant equations in the dominating Pareto front (best expression
seen at each complexity) with:
Expand Down
4 changes: 3 additions & 1 deletion example.jl
Expand Up @@ -7,7 +7,9 @@ options = SymbolicRegression.Options(;
binary_operators=(+, *, /, -), unary_operators=(cos, exp), npopulations=20
)

hall_of_fame = EquationSearch(X, y; niterations=40, options=options, numprocs=4)
hall_of_fame = EquationSearch(
X, y; niterations=40, options=options, parallelism=:multithreading
)

dominating = calculate_pareto_frontier(X, y, hall_of_fame, options)

Expand Down
2 changes: 1 addition & 1 deletion test/test_recorder.jl
Expand Up @@ -18,7 +18,7 @@ options = SymbolicRegression.Options(;
)

hall_of_fame = EquationSearch(
X, y; niterations=5, options=options, paralelism=:multithreading
X, y; niterations=5, options=options, paralellism=:multithreading
)

data = open(options.recorder_file, "r") do io
Expand Down

0 comments on commit 05c6137

Please sign in to comment.