This is an alpha release of v2.0.0. There will still be changes before the release of v2.0.0, likely including new hyperparameter defaults.
Multiple features (update backend to 2.0) (#999)
This PR updates the backend to SymbolicRegression.jl 2.0.0-alpha.8 and exposes several major new features:
- N-ary operators: Support for operators with arbitrary arity (not just unary/binary)
- Added 3-arity operators:
fma(fused multiply-add),clamp, etc. - This can be used via a new
operatorsparameter dictionary:operators={1: ["sin"], 2: ["+", "*"], 3: ["clamp"]}
- Added 3-arity operators:
- Equation guesses: Pass initial equation guesses to guide the search using the
guessesparameter tofit- For example:
guesses=["sin(x0 * 2.1 - 0.5)", "x0 * 3.0 + x2"]provides two guesses - Control injection rate with
fraction_replaced_guesses
- For example:
- Advanced autodiff backends: Experimental support for Mooncake.jl and Enzyme.jl
- Enzyme.jl support via
autodiff_backend="Enzyme"(fragile/experimental) - Mooncake.jl (experimental - currently disabled pending upstream fix)
- Enzyme.jl support via
- Feature node mutation: New mutation operator that directly modifies which features are used
- Control mutation weight with
weight_mutate_feature
- Control mutation weight with
- Worker management:
worker_imports: specify Julia packages to import on workersworker_timeout: control timeout for worker processes
Automatic batching for big data (#1045)
- docs: add vector expression example by @MilesCranmer in #1041
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci[bot] in #1008
- chore(deps): bump actions/checkout from 4 to 5 by @dependabot[bot] in #1009
- ci: update Dockerfile image by @MilesCranmer in #1022
- test: update docker versions by @MilesCranmer in #1023
- chore(deps): bump actions/setup-python from 5 to 6 by @dependabot[bot] in #1027
- deps: update min python to 3.9 by @MilesCranmer in #1052
- deps: bump juliacall requirement by @dependabot[bot] in #1035
- chore(deps): bump actions/checkout from 4 to 5 by @dependabot[bot] in #1049
- chore(deps): bump github/codeql-action from 3 to 4 by @dependabot[bot] in #1050
- chore(deps): bump actions/setup-python from 5 to 6 by @dependabot[bot] in #1051
- chore(deps): update beartype requirement from <0.22,>=0.19 to >=0.19,<0.23 by @dependabot[bot] in #1047
- chore: update pyjuliacall requirement in environment.yml by @MilesCranmer in #1054
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v1.5.9...v2.0.0a1
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci[bot] in #853
- Fix type error in feature selection code by @MilesCranmer in #952
- chore(deps): update juliacall requirement from <0.9.26,>=0.9.24 to >=0.9.24,<0.9.27 by @dependabot[bot] in #980
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v1.5.8...v1.5.9
- fix: compat with python 3.8 by removing beartype by @MilesCranmer in #935
- ci: update workflows to test 3.13 by @MilesCranmer in #929
- style: fix newline in warning by @MilesCranmer in #931
- ci: switch to codecov by @MilesCranmer in #932
- deps: fix local conda env versions by @MilesCranmer in #933
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v1.5.7...v1.5.8
- Enable negative losses by @MilesCranmer in #928
- Recommend TemplateExpressionSpec over ParametricExpressionSpec @MilesCranmer in #920
- Fix multi-output template expressions by @MilesCranmer in #921
- build: switch to hatchling by @MilesCranmer in #888
- chore(deps): bump juliacall from 0.9.24 to 0.9.25 by @dependabot in #925
- fix: turn off double warning for ParametricExpressionSpec by @MilesCranmer in #930
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v1.5.6...v1.5.7
- Added paper contribution and image by @manuel-morales-a in #824
- fix: pickling of inv by @MilesCranmer in #910
- Automated update to backend: v1.10.0 by @github-actions in #890
- @manuel-morales-a made their first contribution in #824
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v1.5.5...v1.5.6
- fix: typing extensions dependency by @MilesCranmer in #885
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v1.5.4...v1.5.5
- Compat with older Python by @MilesCranmer in #884
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v1.5.3...v1.5.4
- fix: change sympy mappings ordering by @romanovzky in #868
- @romanovzky made their first contribution in #868
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v1.5.2...v1.5.3
- fix: mapping of cbrt by @MilesCranmer in #858
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v1.5.1...v1.5.2
- fix: comparison operator parsing by @MilesCranmer in #845
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v1.5.0...v1.5.1
- Change behavior of batching to resample only every iteration; not every eval in astroautomata/SymbolicRegression.jl#421
- This result in a speed improvement for code with
batching=true - It should also result in improved search results with batching, because comparison within a single population is more stable during evolution. In other words, there is no lucky batch phenomenon.
- This also refactors the batching interface to be cleaner. There is a
SubDataset <: Datasetrather than passing around an arrayidxexplicitly. - Note that other than the slight behaviour change, this is otherwise backwards compatible - the old way to write custom loss functions that take
idxwill still be handled.
- This result in a speed improvement for code with
- feat: better error for mismatched eltypes by @MilesCranmer in astroautomata/SymbolicRegression.jl#414
- CompatHelper: bump compat for Optim to 1, (keep existing compat) by @github-actions in astroautomata/SymbolicRegression.jl#403
- feat: explicitly monitor errors in workers by @MilesCranmer in astroautomata/SymbolicRegression.jl#417
- feat: allow recording crossovers by @MilesCranmer in astroautomata/SymbolicRegression.jl#415
- add script for converting record to graphml by @MilesCranmer in astroautomata/SymbolicRegression.jl#416
- ci: redistribute part 1 of test suite by @MilesCranmer in astroautomata/SymbolicRegression.jl#424
- refactor: rename to
.costby @MilesCranmer in astroautomata/SymbolicRegression.jl#423 - fix: batched dataset for optimisation by @MilesCranmer in astroautomata/SymbolicRegression.jl#426
- refactor: task local storage instead of thread local by @MilesCranmer in astroautomata/SymbolicRegression.jl#427
- Update backend to v1.8.0 by @MilesCranmer in #833
- test: update deprecated sklearn test syntax by @MilesCranmer in #834
- chore(deps): bump juliacall from 0.9.23 to 0.9.24 by @dependabot in #815
- use standard library logging by @MilesCranmer in #835
- Remove warning about many features, as not really relevant anymore by @MilesCranmer in #837
- chore(deps): update beartype requirement from <0.20,>=0.19 to >=0.19,<0.21 by @dependabot in #838
- chore(deps): update jax[cpu] requirement from <0.5,>=0.4 to >=0.4,<0.6 by @dependabot in #810
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v1.4.0...v1.5.0
#823 adds support for parameters in template expressions, allowing you to learn expressions under a template, that have custom coefficients which can be optimized.
Along with this, the TemplateExpressionSpec API has changed. (The old API will continue to function, but will not have parametric expressions available).
spec = TemplateExpressionSpec(
"fx = f(x); p[1] + p[2] * fx + p[3] * fx^2",
expressions=["f"],
variable_names=["x"],
parameters={"p": 3},
)This would learn three parameters, for the expression
You can have multiple parameter vectors, and these parameter vectors can also be indexed by categorical features. For example:
### Learn different parameters for each class:
spec = TemplateExpressionSpec(
"p1[category] * f(x1, x2) + p2[1] * g(x1^2)",
expressions=["f", "g"],
variable_names=["x1", "x2", "category"],
parameters={"p1": 3, "p2": 1},
)This will learn an equation of the form:
category variable in X rather than as a category keyword (floating point versions of the categories). This difference means that in a TemplateExpressionSpec, you can actually have multiple categories!
-
Added support for expression-level loss functions via
loss_function_expression, which allows you to specify custom loss functions that operate on the full expression object rather than just its evaluated output. This is particularly useful when working with template expressions. -
Note that the old template expression syntax using function-style definitions is deprecated. Use the new, cleaner syntax instead:
### # Old:
### spec = TemplateExpressionSpec(
### function_symbols=["f", "g"],
### combine="((; f, g), (x1, x2, x3)) -> sin(f(x1, x2)) + g(x3)"
### )
### New:
spec = TemplateExpressionSpec(
"sin(f(x1, x2)) + g(x3)"
expressions=["f", "g"],
variable_names=["x1", "x2", "x3"],
)Full Changelog: v1.3.1...v1.4.0
- Automated update to backend: v1.5.1 by @github-actions in #790
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v1.3.0...v1.3.1
- Expanded support for differential operators via backend 1.5.0 by @MilesCranmer in #782
e.g., say we wish to integrate
import numpy as np
from pysr import PySRRegressor, TemplateExpressionSpec
x = np.random.uniform(1, 10, (1000,)) # Integrand sampling points
y = 1 / (x**2 * np.sqrt(x**2 - 1)) # Evaluation of the integrand
expression_spec = TemplateExpressionSpec(
["f"], "((; f), (x,)) -> D(f, 1)(x)"
)
model = PySRRegressor(
binary_operators=["+", "-", "*", "/"],
unary_operators=["sqrt"],
expression_spec=expression_spec,
maxsize=20,
)
model.fit(x[:, np.newaxis], y)which should correctly find
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v1.2.0...v1.3.0
- Compatibility with new scikit-learn API and test suite by @MilesCranmer in #776
- Add differential operators and input stream specification by @MilesCranmer in #780
- (Note: the differential operators aren't yet in a stable state, and are not yet documented. However, they do work!)
- This PR also adds various GC allocation improvements in the backend.
Frontend Changelog: https://github.com/MilesCranmer/PySR/compare/v1.1.0...v1.2.0
Backend Changelog: https://github.com/MilesCranmer/SymbolicRegression.jl/compare/v1.2.0...v1.4.0
- Automated update to backend: v1.2.0 by @github-actions in #770
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v1.0.2...v1.1.0
- logger fixes: close streams and persist during warm start by @BrotherHa in #763
- Let sympy use log2(x) instead of log(x)/log(2) by @nerai in #712
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v1.0.1...v1.0.2
- Automated update to backend: v1.1.0 by @github-actions in #762
- Fall back to
eagerregistry when needed by @DilumAluthge in #765
- @DilumAluthge made their first contribution in #765
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v1.0.0...v1.0.1
PySR 1.0.0 introduces new features for imposing specific functional forms and finding parametric expressions. It also includes TensorBoard support, along with significant updates to the core algorithm, including some important bug fixes. The default hyperparameters have also been updated based on extensive tuning, with a maxsize of 30 rather than 20.
PySR 1.0.0 introduces new ways to specify the structure of equations through "Expression Specifications", that expose the new backend feature of AbstractExpression:
TemplateExpressionSpec allows you to define a specific structure for your equations. For example:
expression_spec = TemplateExpressionSpec(["f", "g"], "((; f, g), (x1, x2, x3)) -> sin(f(x1, x2)) + g(x3)")ParametricExpressionSpec enables fitting expressions that can adapt to different categories of data with per-category parameters:
expression_spec = ParametricExpressionSpec(max_parameters=2)
model = PySRRegressor(
expression_spec=expression_spec
binary_operators=["+", "*", "-", "/"],
)
model.fit(X, y, category=category) # Pass category labelsThe new TensorBoardLoggerSpec enables logging of the search process, as well as hyperparameter recording, which exposes the AbstractSRLogger feature of the backend:
logger_spec = TensorBoardLoggerSpec(
log_dir="logs/run",
log_interval=10, # Log every 10 iterations
)
model = PySRRegressor(logger_spec=logger_spec)Features logged include:
- Loss curves over time at each complexity level
- Population statistics
- Pareto "volume" logging (measures performance over all complexities with a single scalar)
- The min loss over time
The default hyperparameters have been significantly revised based on testing:
- Increased default
maxsizefrom 20 to 30, as I noticed that many people use the defaults, and this maxsize would allow for more accurate expressions. - New mutation operator weights optimized for better performance, along the new mutation "rotate tree."
- Improved search parameters tuned using Pareto front volume calculations.
- Default
niterationsincreased from 40 to 100, also to support better accuracy (at the expense of slightly longer default search times).
- New output organization: Results are now stored in
outputs/<run_id>/rather than in the directory of execution. - Improved performance with better parallelism handling
- Support for Python 3.10+
- Updated Julia backend to version 1.10+
- Fix for aliasing issues in crossover operations
- Minimum Python version is now 3.10, and minimum Julia version is 1.10
- Output file structure has changed to use directories
- Parameter name updates:
equation_file→output_directory+run_id- Added clearer naming for parallelism options, such as
parallelism="serial"rather than the oldmultithreading=False, procs=0which was unclear
The documentation has a new home at https://ai.damtp.cam.ac.uk/pysr/
- Create
load_all_packagesto install Julia extensions by @MilesCranmer in #688 - Apptainer definition file for PySR by @wkharold in #687
- JuliaCall 0.9.23 by @MilesCranmer in #703
- build(deps): bump juliacall from 0.9.21 to 0.9.22 by @dependabot in #695
- @wkharold made their first contribution in #687
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.19.3...v0.19.4
- build(deps): bump juliacall from 0.9.20 to 0.9.21 by @dependabot in #678
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.19.2...v0.19.3
- Avoid automatic upgrade to Julia 1.11 by @MilesCranmer in #671
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.19.1...v0.19.2
- Bump docker/setup-qemu-action from 2 to 3 by @dependabot in #506
- fix:
from pysr import *by @MilesCranmer in #670
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.19.0...v0.19.1
- BREAKING: Disable automatic sympy simplification by @MilesCranmer in #658
- Build: update numpy version by @MilesCranmer in #650
- Build: bump docker/build-push-action from 5 to 6 by @dependabot in #652
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.18.5...v0.19.0
-
Per-variable custom complexities by @MilesCranmer in #649
model.fit(X, y, complexity_of_variables=[1, 3]) # run a search with feature 1 having complexity 1 and feature 2 with complexity 3
-
Automatically suggest similar parameters by @MilesCranmer in #620
- Bump julia-actions/cache from 1 to 2 by @dependabot in #621
- Update pysr_demo.ipynb by @VishalJ99 in #624
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #612
- Bump docker/login-action from 2 to 3 by @dependabot in #509
- More extensive typing stubs and associated refactoring by @MilesCranmer in #609
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.18.4...v0.18.5
- Allow per-variable complexity (astroautomata/SymbolicRegression.jl#324) (@MilesCranmer)
- ci: split up test suite into multiple runners (astroautomata/SymbolicRegression.jl#311) (@MilesCranmer)
- chore(deps): bump julia-actions/cache from 1 to 2 (astroautomata/SymbolicRegression.jl#315) (https://github.com/dependabot[bot])
- CompatHelper: bump compat for DynamicQuantities to 0.14, (keep existing compat) (astroautomata/SymbolicRegression.jl#317) (@github-actions[bot])
- Use DispatchDoctor.jl to wrap entire package with
@stable(astroautomata/SymbolicRegression.jl#321) (@MilesCranmer) - CompatHelper: bump compat for MLJModelInterface to 1, (keep existing compat) (astroautomata/SymbolicRegression.jl#322) (@github-actions[bot])
- Mark more functions as stable (astroautomata/SymbolicRegression.jl#323) (@MilesCranmer)
- Refactor tests to use TestItems.jl (astroautomata/SymbolicRegression.jl#325) (@MilesCranmer)
Full Changelog: https://github.com/MilesCranmer/SymbolicRegression.jl/compare/v0.24.4...v0.24.5
- @VishalJ99 made their first contribution in #624
- Add dimensionless constants mode; update Python version constraints; upgrade juliacall to 0.9.20 (#608) (@MilesCranmer)
- Fix sign typo in example docs (#611) (@hvaara)
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.18.3...v0.18.4
- Up to 40% speedup for default settings via more parallelism inside workers (astroautomata/SymbolicRegression.jl#304) (@MilesCranmer)
- feat: use
?for wildcard units instead of⋅(astroautomata/SymbolicRegression.jl#307) (@MilesCranmer) - refactor: fix some more type instabilities (astroautomata/SymbolicRegression.jl#308) (@MilesCranmer)
- refactor: remove unused Tricks dependency (astroautomata/SymbolicRegression.jl#309) (@MilesCranmer)
- Add option to force dimensionless constants (astroautomata/SymbolicRegression.jl#310) (@MilesCranmer)
Full Changelog: https://github.com/MilesCranmer/SymbolicRegression.jl/compare/v0.24.2...v0.24.4
- @hvaara made their first contribution in #611
- Automated update to backend: v0.24.3 by @github-actions in #605
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.18.2...v0.18.3
Full Changelog: https://github.com/MilesCranmer/SymbolicRegression.jl/compare/v0.24.1...v0.24.2
- Add missing
greateroperator in sympy mapping by @MilesCranmer in #590 - Bump julia-actions/setup-julia from 1 to 2 by @dependabot in #591
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #537
- Automated update to backend: v0.24.2 by @MilesCranmer in #598
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.18.1...v0.18.2
Merged pull requests:
- Bump julia-actions/setup-julia from 1 to 2 (astroautomata/SymbolicRegression.jl#300) (@dependabot[bot])
- [pre-commit.ci] pre-commit autoupdate (astroautomata/SymbolicRegression.jl#301) (@pre-commit-ci[bot])
- A small update on examples.md for 1-based indexing (astroautomata/SymbolicRegression.jl#302) (@liuyxpp)
- Fixes for Julia 1.11 (astroautomata/SymbolicRegression.jl#303) (@MilesCranmer)
Closed issues:
- API Overhaul (astroautomata/SymbolicRegression.jl#187)
- [Feature]: Training on high dimensions X (astroautomata/SymbolicRegression.jl#299)
Full Changelog: https://github.com/MilesCranmer/SymbolicRegression.jl/compare/v0.24.1...v0.24.2
- Revert GitHub-based registry for backend by @MilesCranmer in #587
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.18.0...v0.18.1
- fix TypeError when a variable name matches a builtin python function by @tomjelen in #558
- Update to backend: v0.24.0 by @MilesCranmer in #564
- Fix extensions not being added to package env by @MilesCranmer in #579
- Bump backend version and switch to GitHub-based registry by @MilesCranmer in #580
Filtered to only include relevant ones for Python frontend. Also note that not all backend features, like graph-based expressions/program synthesis, are supported yet, so I don't mention those changes yet.
-
(BREAKING) The
swap_operandsmutation contributed by @foxtran now has a default weight of 0.1 rather than 0.0. -
(BREAKING) The Dataset struct has had many of its field declared immutable, as a safety precaution.
- If you had relied on the mutability of the struct to set parameters after initializing it, or had changed any properties of the dataset within a loss function (which actually would break assumptions outside the loss function anyways), you will need to modify your code. Note you can always copy fields of the dataset to variables and then modify those variables
-
LoopVectorization.jl has been moved to a package extension. PySR will install automatically at first use of
turbo=Truerather than by default, which means faster install time and startup time.- Note that LoopVectorization will no longer result in improved performance in Julia 1.11 and thus
turbo=Truewill have no effect on that version (due to internal changes in Julia), which is why I have instead done the following:
- Note that LoopVectorization will no longer result in improved performance in Julia 1.11 and thus
-
Bumper.jl support added. Passing
bumper=truetoPySRRegressor()will result in faster performance.- Uses bump allocation (see rust package bumpalo for a good explanation) in the expression evaluation which can get speeds equivalent to LoopVectorization and sometimes even better due to better management of allocations rather than relying on garbage collection. Seems like a pretty good alternative, and doesn't rely on manipulating Julia internals for performance (astroautomata/SymbolicRegression.jl#287)
-
Various fixes to distributed compute; confirmed Slurm support again!
- Maybe from astroautomata/SymbolicRegression.jl#297 - ensures ClusterManagers.jl is loaded on workers
-
Now prefer to use new keyword-based constructors for nodes:
Node{T}(feature=...) # leaf referencing a particular feature column Node{T}(val=...) # constant value leaf Node{T}(op=1, l=x1) # operator unary node, using the 1st unary operator Node{T}(op=1, l=x1, r=1.5) # binary unary node, using the 1st binary operator
rather than the previous constructors Node(op, l, r) and Node(T; val=...) (though those will still work; just with a depwarn). If you did any construction of nodes manually, note the new syntax. (Old syntax will still work though)
-
Formatting overhaul of backend (astroautomata/SymbolicRegression.jl#278)
-
Upgraded Optim to 1.9
-
Upgraded DynamicQuantities to 0.13
-
Upgraded DynamicExpressions to 0.16
-
The main search loop in the backend has been greatly refactored for readability and improved type inference. It now looks like this (down from a monolithic ~1000 line function)
function _equation_search( datasets::Vector{D}, ropt::RuntimeOptions, options::Options, saved_state ) where {D<:Dataset} _validate_options(datasets, ropt, options) state = _create_workers(datasets, ropt, options) _initialize_search!(state, datasets, ropt, options, saved_state) _warmup_search!(state, datasets, ropt, options) _main_search_loop!(state, datasets, ropt, options) _tear_down!(state, ropt, options) return _format_output(state, ropt) end
Backend changes: https://github.com/MilesCranmer/SymbolicRegression.jl/compare/v0.23.1...v0.24.1
- @tomjelen made their first contribution in #558
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.17.4...v0.18.0
Small patch to Julia version to avoid buggy libgomp in 1.10.1 and 1.10.2.
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.17.3...v0.17.4
- Bump juliacall from 0.9.15 to 0.9.19 by @dependabot in #569
- Upstreamed patching of
sevalto support multiple expressions
- Upstreamed patching of
- remove repeated operator by @RaulPL in #573
- @RaulPL made their first contribution in #573
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.17.2...v0.17.3
- All cell state in bio image paper by @chris-soelistyo in #560
- Refactor update_backend.yml workflow by @sefffal in #562
- Limit to Julia 1.6.7-1.10.0 and 1.10.3+ by @MilesCranmer in #565
- @chris-soelistyo made their first contribution in #560
- @sefffal made their first contribution in #562
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.17.1...v0.17.2
- Fix y_units bug by @MilesCranmer in #545
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.17.0...v0.17.1
- Bump docker/build-push-action from 3 to 5 by @dependabot in #510
- Bump actions/cache from 3 to 4 by @dependabot in #526
- Update colab notebook to use juliaup by @MilesCranmer in #531
- Bump peter-evans/create-pull-request from 5 to 6 by @dependabot in #539
- (BREAKING) Rewrite Julia interface with PyJulia -> JuliaCall; other changes by @MilesCranmer @cjdoris @mkitti in #535
- (BREAKING) Changed PyJulia with JuliaCall
- Need to change
eval->seval - Manually converting to
Vectorwhen calling SymbolicRegression.jl functions (otherwise would get passed asPyList{Any}; see JuliaPy/PythonCall.jl#441) - Wrapped
equation_searchcode withjl.PythonCall.GC.disable()to avoid multithreading-related segfaults (JuliaPy/PythonCall.jl#298) - Manually convert
np.str_tostrbefore passing tovariable_names, otherwise it becomes aPyArrayand not aString(might be worth adding a workaround, it seems like PyJulia does this automatically)
- Need to change
- (BREAKING) Julia is now installed automatically when you import
pysr(via JuliaCall) - (BREAKING) The user no longer needs to run
python -m pysr install. The install process is done by JuliaCall at import time.- Removed code related to
pysr.install()andpython -m pysr installbecause JuliaCall now handles this. python -m pysr installwill not give a warning and do nothing.
- Removed code related to
- (BREAKING) Remove the feynman problems dataset. Didn't seem good to have a dataset within a library itself.
- (BREAKING) Deprecated
julia_projectargument (ignored; no effect). The user now needs to set this up by customizingjuliapkg.json. See updated documentation for instructions. - (BREAKING) Switch from
python -m pysr.test [test]topython -m pysr test [test]. - Switches to
pyproject.tomlfor building rather thansetup.py. However,setup.py installshould still work. - Dependencies are now managed by pyjuliapkg rather than the custom code we made. Simplifies things a lot!
- Rather than storing the raw julia variables in
PySRRegressor, I am now storing a serialized version of them. This means you can now pickle the search state and warm-start the search from a file, in another Python process!- Not breaking! Because
self.raw_julia_state_will deserialize it automatically for you
- Not breaking! Because
- SymbolicRegression is now available to import from PySR:
from pysr import SymbolicRegression as SR
x1 = SR.Node(feature=1) # Create expressions manually- SymbolicRegression options are accessible in
<model>.julia_options_(generated from a serialized format for pickle safety) so that the user can call a variety of functions inSymbolicRegression.jldirectly. - Deprecated various kwargs to match SymbolicRegression.jl (old names will still work, so this is not breaking):
ncyclesperiteration => ncycles_per_iterationloss => elementwise_lossfull_objective => loss_function
- Fixes Jupyter printing by automatically loading the
juliacall.ipythonextension at import time - Adds Zygote.jl to environment by default
- Does unittesting on an example Jupyter notebook
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.16.9...v0.17.0
- Swap operands mutation by @foxtran in #512
- @foxtran made their first contribution in #512
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.16.8...v0.16.9
- Install
typing_extensionsfor compatibility with Python 3.7 by @MilesCranmer in #497 - Create dependabot.yml by @MilesCranmer in #500
- Fix docker CI nightly by @MilesCranmer in #499
- Enforce upper bound compats by @MilesCranmer in #498
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.16.7...v0.16.8
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #495
- Warn the user on Python 3.12 by @MilesCranmer in #496
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.16.6...v0.16.7
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #488
- Add parameter for specifying
--heap-size-hinton spawned Julia processes by @MilesCranmer in #493
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.16.5...v0.16.6
- Add more piecewise operators by @MilesCranmer in #486
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.16.4...v0.16.5
- Requesting addition of paper to research examples by @tmengel in #415
- Incorporate pre-commit hooks by @MilesCranmer in #425
- Refactor sympy and export functionality by @MilesCranmer in #427
- Refactor utility functions in
sr.pyby @MilesCranmer in #428 - [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #431
- Add paper "Discovery of a Planar Black Hole Mass Scaling Relation for Spiral Galaxies" by @ZehaoJin in #437
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #440
- Added "min" and "max" sympy mapping by @tanweer-mahdi in #473
- Added "round" operator in the Sympy mappings by @tanweer-mahdi in #474
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #446
- Automated update to backend: v0.22.5 by @MilesCranmer in #482
- @tmengel made their first contribution in #415
- @ZehaoJin made their first contribution in #437
- @tanweer-mahdi made their first contribution in #473
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.16.3...v0.16.4
- Automated update to backend: v0.22.4 by @MilesCranmer in #413
- Fixes world age issue
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.16.2...v0.16.3
- Automated update to backend: v0.22.3 by @MilesCranmer in #409
- CompatHelper: bump compat for DynamicExpressions to 0.13, (keep existing compat) by @github-actions in astroautomata/SymbolicRegression.jl#250
- Fix type stability of deterministic mode by @MilesCranmer in astroautomata/SymbolicRegression.jl#251
- Faster random sampling of nodes by @MilesCranmer in astroautomata/SymbolicRegression.jl#252
- Faster copying of MutationWeights by @MilesCranmer in astroautomata/SymbolicRegression.jl#253
- Hotfix for breaking change in Optim.jl by @MilesCranmer in astroautomata/SymbolicRegression.jl#256
Backend changes: https://github.com/MilesCranmer/SymbolicRegression.jl/compare/v0.22.2...v0.22.3
Frontend changes: https://github.com/MilesCranmer/PySR/compare/v0.16.1...v0.16.2
- Automated update to backend: v0.22.2 by @MilesCranmer in #404
- Expand aqua test suite (astroautomata/SymbolicRegression.jl#246) (@MilesCranmer)
- Return more descriptive errors for poorly defined operators (astroautomata/SymbolicRegression.jl#247) (@MilesCranmer)
Backend Changelog: Diff since v0.22.1 PySR Changelog: https://github.com/MilesCranmer/PySR/compare/v0.16.0...v0.16.1
- Backend version update in #400. Includes:
- Algorithmic improvements to batching
- Code quality improvements (some method ambiguities, old exports)
- (Algorithm modification) Evaluate on fixed batch when building per-population hall of fame in astroautomata/SymbolicRegression.jl#243
- This only affects searches that use
batching=true. It results in improved searches on large datasets, as the "winning expression" is not biased towards an expression that landed on a lucky batch. - Note that this only occurs within an iteration. Evaluation on the entire dataset still happens at the end of an iteration and those loss measurements are used for absolute comparison between expressions.
- This only affects searches that use
- (Algorithm modification) Deprecates the
fast_cyclefeature in astroautomata/SymbolicRegression.jl#243. Use of this parameter will have no effect.- Was removed to ease maintenance burden and because it doesn't have a use. This feature was created early on in development as a way to get parallelism within a population. It is no longer useful as you can parallelize across populations.
- Add Aqua.jl to test suite in astroautomata/SymbolicRegression.jl#245 for code quality control
- CompatHelper: bump compat for DynamicExpressions to 0.12, (keep existing compat) in astroautomata/SymbolicRegression.jl#242
- Is able to avoids method invalidations when using operators to construct expressions manually by modifying a global constant mapping of operator => index, rather than
@eval-ing new operators. - This only matters if you were using operators to build trees, like
x1 + x2. All internal search code usesNode()explicitly to build expressions, so did not rely on method invalidation at any point.
- Is able to avoids method invalidations when using operators to construct expressions manually by modifying a global constant mapping of operator => index, rather than
Backend Changelog: https://github.com/MilesCranmer/SymbolicRegression.jl/compare/v0.21.5...v0.22.1
PySR Changelog: https://github.com/MilesCranmer/PySR/compare/v0.15.4...v0.16.0
- Warn user when using power laws by @MilesCranmer in #399
- This seems like the most common configuration mistake in PySR: using the
^operator without settingconstraints, leading to extremely complex expressions with poor generalization properties. Thus, this warning will let the user know about it if they set up^without constraints.
- This seems like the most common configuration mistake in PySR: using the
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.15.3...v0.15.4
- Use unicode in printing without needing to decode by @MilesCranmer in #398
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.15.2...v0.15.3
- Ensure files are read as utf-8 on all operating systems by @MilesCranmer in #396
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.15.1...v0.15.2
- Fix compat with old scikit-learn versions by @MilesCranmer in #393
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.15.0...v0.15.1
- Backend version update in #389. Includes:
- Dimensional analysis (see docs examples page)
- Printing improvements
- Many misc changes (see below)
- astroautomata/SymbolicRegression.jl#228 and astroautomata/SymbolicRegression.jl#230 and astroautomata/SymbolicRegression.jl#231 and astroautomata/SymbolicRegression.jl#235
- Dimensional analysis (228)
- Allows you to (softly) constrain discovered expressions to those that respect physical dimensions
- Specify
X_unitsandy_units(see https://astroautomata.com/PySR/examples/#10-dimensional-constraints)
- Printing improvements (228)
- By default, only 5 significant digits are now printed, rather than the entire float. You can change this with the
print_precisionoption. - In the default printed equations,
x₁is used rather thanx1. y =is printed at the start (ory₁ =for multi-output). With units this becomes, for example,y[kg] =.
- By default, only 5 significant digits are now printed, rather than the entire float. You can change this with the
- Misc
- Easier to convert from MLJ interface to SymbolicUtils (via
node_to_symbolic(::Node, ::AbstractSRRegressor)) (228) - Improved precompilation (228)
- Various performance and type stability improvements (228)
- Inlined the recording option to speedup compilation (230)
- Updated Julia tutorials to use MLJ rather than low-level interface (228)
- Moved JSON3.jl to extension (231)
- Use PackageExtensionsCompat.jl over Requires.jl (231)
- Require LossFunctions.jl to be 0.10 (231)
- Batching inside optimization loop + batching support for custom objectives by (235)
- Update docker defaults: Julia=1.9.1; Python=3.10.11 in #371
- Easier to convert from MLJ interface to SymbolicUtils (via
- Dimensional analysis (228)
Backend Changelog: https://github.com/MilesCranmer/SymbolicRegression.jl/compare/v0.20.0...v0.21.0
PySR Changelog: https://github.com/MilesCranmer/PySR/compare/v0.14.3...v0.15.0
- Self-repairing PyCall installation to lower entrance barrier for new users by @MilesCranmer and @mkitti in #363
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.14.2...v0.14.3
- Recommend user install with
--enable-sharedby @MilesCranmer in #352 - Automated update to backend: v0.19.1 by @MilesCranmer in #355
Merged pull requests on backend:
- CompatHelper: bump compat for StatsBase to 0.34, (keep existing compat) (astroautomata/SymbolicRegression.jl#202) (@github-actions[bot])
- (Soft deprecation) change
varMaptovariable_names(astroautomata/SymbolicRegression.jl#219) (@MilesCranmer) - (Soft deprecation) rename
EquationSearchtoequation_search(astroautomata/SymbolicRegression.jl#222) (@MilesCranmer) - Fix equation splitting for unicode variables (astroautomata/SymbolicRegression.jl#223) (@MilesCranmer)
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.14.1...v0.14.2
- Automated update to backend: v0.19.0 by @MilesCranmer in #340
- ~30% faster startup time on first search (https://github.com/MilesCranmer/SymbolicRegression.jl/releases/tag/v0.19.0)
- Let user know when compilation is taking place by @MilesCranmer in #341
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.14.0...v0.14.1
- Added CLI to run pysr.install() to install Julia dependencies by @w2ll2am in #298
- Let's you install PySR with
python -m pysr installrather thanpython -c 'import pysr; pysr.install()' - This CLI also has other options available (precompilation, Julia project name, etc.)
- Let's you install PySR with
- @w2ll2am made their first contribution in #298
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.13.0...v0.14.0
- Test Julia 1.9 by @MilesCranmer in #329
- Automated update to backend: v0.18.0 by @MilesCranmer in #331
- Overload ^ if user passes explicitly (astroautomata/SymbolicRegression.jl#201) (@MilesCranmer)
- Upgrade DynamicExpressions to 0.8; LossFunctions to 0.10 (astroautomata/SymbolicRegression.jl#206) (@github-actions[bot])
- Show expressions evaluated per second (astroautomata/SymbolicRegression.jl#209) (@MilesCranmer)
- Cache complexity of expressions whenever possible (astroautomata/SymbolicRegression.jl#210) (@MilesCranmer)
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.12.3...v0.13.0
- Highlight contributors by @MilesCranmer in #301
- Automated update to backend: v0.17.1 by @MilesCranmer in #320
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.12.2...v0.12.3
- Add paper 'Electron Transfer Rules of Minerals under Pressure…' by @GCaptainNemo in #288
- Fix colab notebook example by @MilesCranmer in #295
- Add paper: "Data-Driven Equation Discovery of a Cloud Cover Parameterization" by @agrundner24 in #302
- Pass through
enable_autodiffparameter by @MilesCranmer in #316
- @GCaptainNemo made their first contribution in #288
- @agrundner24 made their first contribution in #302
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.12.1...v0.12.2
- Allow user to specify full objective functions by @MilesCranmer in #276
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.12.0...v0.12.1
- Complex-valued expressions by @MilesCranmer in #281
- Various fixes in backend (see https://github.com/MilesCranmer/SymbolicRegression.jl/releases/tag/v0.16.0)
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.11.17...v0.12.0
- Update backend version with warm start fix by @MilesCranmer in #271
- This means that you can change the dataset or loss function, and
warm_start=Truewill still work, and the losses will be re-computed.
- This means that you can change the dataset or loss function, and
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.11.16...v0.11.17
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.11.15...v0.11.16
- Bump backend version with data race fix by @MilesCranmer in #268
- Incorporates depth check into constraints, rather than in mutation step.
- Fixes one instance of a data race (appears to be remaining issues, however)
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.11.14...v0.11.15
- Update backend with constraints fix by @MilesCranmer in #265
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.11.13...v0.11.14
- Fix latex_table assertion for multi-output by @MilesCranmer in #253
- Make precompilation optional by @MilesCranmer in #263
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.11.12...v0.11.13
- Make docker build multi-stage by @MilesCranmer in #235
- Create interactive API reference page by @MilesCranmer in #247
- Bump backend version with stream fix; fixes #250 by @MilesCranmer in #252
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.11.11...v0.11.12
- Make Julia startup options configurable; set optimize=3 by @MilesCranmer in #228
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.11.10...v0.11.11
- Clean up dockerfile by @MilesCranmer in #223
- Update backend version with improved resource monitoring by @MilesCranmer in #227
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.11.9...v0.11.10
- Refactor testing suite to have CLI by @MilesCranmer in #221
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.11.8...v0.11.9
- Fix PyCall not giving traceback by @MilesCranmer in #218
- Fixed safe operators; make progress bar print to stderr by @MilesCranmer in #219
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.11.7...v0.11.8
- Expand nightly conda-forge tests to other Python versions by @MilesCranmer in #212
- Clean up parameter groupings in docs by @MilesCranmer in #214
- Add optimization-as-mutation, and adaptive parsimony by @MilesCranmer in #217
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.11.6...v0.11.7
- Speed up evaluation with
turboparameter by @MilesCranmer in #208
Space.Balls.-.Ludicrous.Speed-ygE01sOhzz0.mp4
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.11.5...v0.11.6
- 30-50% Faster evaluation, and perform explicit version assertion for backend by @MilesCranmer in #205
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.11.4...v0.11.5
- Fix conda forge installs by @MilesCranmer in #202
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.11.3...v0.11.4
- Faster evaluation for constant sub-expressions (SymbolicRegression.jl#129)
- Will now check variable names for spaces and other non-alphanumeric characters, aside from underscores. Before this would only raise an issue after a search, when trying to pickle the saved data.
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.11.2...v0.11.3
(Fix for conda-forge build)
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.11.1...v0.11.2
- Added Customization page in the docs for tweaking the backend's loss function and constraints.
- Adding two entries to papers.yml by @JayWadekar in #192
- Explicitly deprecate Julia <= 1.5 by @MilesCranmer in #194
- Allow custom shared projects for
julia_projectby @MilesCranmer @mkitti in #197- e.g., this would allow you to run with
@my-projectand it will set up a shared Julia project undermy-project(in the environments dir)
- e.g., this would allow you to run with
- @JayWadekar made their first contribution in #192
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.11.0...v0.11.1-1
- Update backend #191
- Includes high-precision constants when
precision=64 - Enables datasets with zero variance (to allow fitting a constant)
- Changes, e.g.,
abs(x)^ytox^y, with expressions avoided altogether for invalid input. This is because the former would sometimes give weird functional forms by exploiting the cusp atx=0. Thanks to @johanbluecreek.
- Includes high-precision constants when
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.10.4...v0.11.0
- Fix install for Julia <=1.6 by @MilesCranmer @mkitti in #188
- PyJulia will now launch directly into the shared
pysr-{version}environment, rather than activating it later.
- PyJulia will now launch directly into the shared
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.10.3...v0.10.4
- Displays a warning message when PyTorch is imported before PyJulia starts. See pytorch/pytorch#78829. The only current solution is to start Julia beforehand.
- New docs! Using Material-Mkdocs:
- Set JULIA_PROJECT, use Pkg.add once by @mkitti in #186
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.10.1...v0.10.2
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.10.0...v0.10.1
- Easy loading from auto-generated checkpoint files by @MilesCranmer w/ review @tttc3 @Pablo-Lemos in #167
- Use
.from_fileto load from the auto-generated.pklfile.
- Use
- LaTeX table generator by @MilesCranmer w/ review @tttc3 @kazewong in #156
- Generate a LaTeX table of discovered equations with
.latex_table()
- Generate a LaTeX table of discovered equations with
- Improved default model selection strategy by @MilesCranmer in #177
- Old strategy is available as
model_selection="score"
- Old strategy is available as
- Add opencontainers image-spec to
Dockerfileby @SauravMaheshkar w/ review @MilesCranmer in #166 - Switch to comma-based csv format by @MilesCranmer in #176
- Fixed conversions to torch and JAX when a rational number appears in the sympy expression (https://github.com/MilesCranmer/PySR/commit/17c9b1a1762efbd8e021d275491f75cc6dcea8f1, https://github.com/MilesCranmer/PySR/commit/f119733698e4517e34cc902c78dcb95d450c0c80)
- Fixed pickle saving when trained with multi-output (https://github.com/MilesCranmer/PySR/commit/3da0df512ee295f446ceb0ae6e2c39fb0e380618)
- Fixed pickle saving when using custom operators with defined sympy -> jax/torch/numpy mappings
- Backend fix avoids use of Julia's
cpwhich is buggy for some file systems (e.g., EOS)
- @SauravMaheshkar made their first contribution in #166
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.9.0...v0.10.0
- Refactor of PySRRegressor by @tttc3 in #146
- PySRRegressor is now completely compatible with scikit-learn.
- PySRRegressor can be stored in a pickle file, even after fitting, and then be reloaded and used with
.predict() PySRRegressor.equations->PySRRegressor.equations_
- @tttc3 made their first contribution in #146
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.8.7...v0.9.0
- Custom complexities for operators, constants, and variables (#138)
- Early stopping conditions (#134)
- Based on a certain loss value being achieved
- Max number of evaluations (for theoretical studies of genetic algorithms, rather than anything practical).
- Work with specified expression rather than the one given by
model_selection, by passingindexto the function you wish to use (e.g,.model.predict(X, index=5)would use the 5th equation.).
Full Changelog since v0.8.1: https://github.com/MilesCranmer/PySR/compare/v0.8.1...v0.8.5
- Enable distributed processing with ClusterManagers.jl from #133
Full Changelog: https://github.com/MilesCranmer/PySR/compare/v0.8.0...v0.8.1
This new release updates the entire set of default PySR parameters according to the ones presented in #115. These parameters have been tuned over nearly 71,000 trials. See the discussion for further info.
Additional changes:
- Nested constraints implemented. For example, you can now prevent
sinandcosfrom being repeatedly nested, by using the argument:nested_constraints={"sin": {"sin": 0, "cos": 0}, "cos": {"sin": 0, "cos": 0}}. This argument states that within asinoperator, you can only have a max depth of 0 for othersinorcos. The same is done forcos. The argumentnested_constraints={"^": {"+": 2, "*": 1, "^": 0}}states that within a pow operator, you can only have 2 things added, or 1 use of multiplication (i.e., no double products), and zero other pow operators. This helps a lot with finding interpretable expressions! - New parsimony algorithm (backend change). This seems to help searches quite a bit, especially when one is searching for more complex expressions. This is turned on by
use_frequency_in_tournamentwhich is now the default. - Many backend improvements: speed, bug fixes, etc.
- Improved stability of multi-processing (backend change). Thanks to @CharFox1.
- Auto-differentiation implemented (backend change). This isn't used by default in any instances right now, but could be used by optimization later. Thanks to @kazewong.
- Improved testing coverage of weird edge cases.
- All parameters to PySRRegressor have been cleaned up to be in snake_case rather than CamelCase. The backend is also now almost entirely snake_case for internal functions. +Other readability improvements. Thanks to @bstollnitz and @patrick-kidger for the suggestions.
PySR Version 0.6.0
Large changes:
- Exports to JAX, PyTorch, NumPy. All exports have a similar interface. JAX and PyTorch allow the equation parameters to be trained (e.g., as part of some differentiable model). Read https://pysr.readthedocs.io/en/latest/docs/options/#callable-exports-numpy-pytorch-jax for details. Thanks Patrick Kidger for the PyTorch export.
- Multi-output
yinput is allowed, and the backend will efficiently batch over each output. A list of dataframes is returned by pysr for these cases. Allbest_*functions return a list as well. - BFGS optimizer introduced + more stable parameter search due to back tracking line search.
Smaller changes since 0.5.16:
- Expanded tests, coverage calculation for PySR
- Improved (pre-processing) feature selection with random forest
- New default parameters for search:
- annealing=False (no annealing works better with the new code. This is equivalent to alpha=infinity)
- useFrequency=True (deals with complexity in a smarter way)
- npopulations = 20
procs*4 - progress=True (show a progress bar)
- optimizer_algorithm="BFGS"
- optimizer_iterations=10
- optimize_probability=1
- binary_operators default = ["+", "-", "/", "*"]
- unary_operators default = []
- Warnings:
- Using maxsize > 40 will trigger a warning mentioning how it will be slow and use a lot of memory. Will mention to turn off
useFrequency, and perhaps also usewarmupMaxsizeBy.
- Using maxsize > 40 will trigger a warning mentioning how it will be slow and use a lot of memory. Will mention to turn off
- Deprecated nrestarts -> optimizer_nrestarts
- Printing fixed in Jupyter
With versions v0.4.0/v0.4.0, SymbolicRegression.jl and PySR have now been completely disentangled: PySR is 100% Python code (with some Julia meta-programming), and SymbolicRegression.jl is 100% Julia code.
PySR now works by activating a Julia env that has SymbolicRegression.jl as a dependency, and making calls to it! By default it will set up a Julia project inside the pip install location, and install requirements at the user's confirmation, though you can pass an arbitrary project directory as well (e.g., if you want to use PySR but also tweak the backend). The nice thing about this is that for Python users, all you need to do is install a Julia binary somewhere, and they should be good to go. And for Julia users, you never need to touch the Python side.
The SymbolicRegression.jl backend also sets up workers automatically & internally now, so one never needs to call @everywhere when setting things up. The same is true even with locally-defined functions - these get passed to workers!
With PySR importing the latest Julia code, this also means it gets new simplification routines powered by SymbolicUtils.jl, which seem to help improve the equations discovered.
Populations don't block eachother, which gives a large speedup especially for large numbers of populations. This was fixed by using RemoteChannel() in Julia.
Some populations happen to take longer than others - perhaps they have very complex equations - and can therefore block others that have finished early. This lets the processor work on the next population to be finished.
Uses equation from Cranmer et al. (2020) https://arxiv.org/abs/2006.11287 to score equations, and prints this alongside MSE. This makes symbolic regression more robust to noise.
