Pysr

Latest version: v1.0.0

Safety actively analyzes 685838 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 13

1.0.0

Template Expressions
`TemplateExpressionSpec` allows you to define a specific structure for your equations. For example:

python
expression_spec = TemplateExpressionSpec(
function_symbols=["f", "g"],
combine="((; f, g), (x1, x2, x3)) -> sin(f(x1, x2)) + g(x3)"
)


Parametric Expressions
`ParametricExpressionSpec` enables fitting expressions that can adapt to different categories of data with per-category parameters:

python
expression_spec = ParametricExpressionSpec(max_parameters=2)
model = PySRRegressor(
expression_spec=expression_spec
binary_operators=["+", "*", "-", "/"],
)
model.fit(X, y, category=category) Pass category labels


Improved Logging with TensorBoard

The new `TensorBoardLoggerSpec` enables logging of the search process, as well as hyperparameter recording, which exposes the `AbstractSRLogger` feature of the backend:

python
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

Algorithm Improvements

Updated Default Parameters

The default hyperparameters have been significantly revised based on testing:

- Increased default `maxsize` from 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 `niterations` increased from 40 to 100, also to support better accuracy (at the expense of slightly longer default search times).

Core Changes

- 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

Breaking Changes

- Minimum Python version is now 3.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 old `multithreading=False, procs=0` which was unclear

Documentation

The documentation has a new home at https://ai.damtp.cam.ac.uk/pysr/

0.19.4

What's Changed
* Create `load_all_packages` to install Julia extensions by MilesCranmer in https://github.com/MilesCranmer/PySR/pull/688
* Apptainer definition file for PySR by wkharold in https://github.com/MilesCranmer/PySR/pull/687
* JuliaCall 0.9.23 by MilesCranmer in https://github.com/MilesCranmer/PySR/pull/703
* build(deps): bump juliacall from 0.9.21 to 0.9.22 by dependabot in https://github.com/MilesCranmer/PySR/pull/695

New Contributors
* wkharold made their first contribution in https://github.com/MilesCranmer/PySR/pull/687

**Full Changelog**: https://github.com/MilesCranmer/PySR/compare/v0.19.3...v0.19.4

0.19.3

What's Changed
* build(deps): bump juliacall from 0.9.20 to 0.9.21 by dependabot in https://github.com/MilesCranmer/PySR/pull/678


**Full Changelog**: https://github.com/MilesCranmer/PySR/compare/v0.19.2...v0.19.3

0.19.2

What's Changed
* Avoid automatic upgrade to Julia 1.11 by MilesCranmer in https://github.com/MilesCranmer/PySR/pull/671


**Full Changelog**: https://github.com/MilesCranmer/PySR/compare/v0.19.1...v0.19.2

0.19.1

What's Changed
* Bump docker/setup-qemu-action from 2 to 3 by dependabot in https://github.com/MilesCranmer/PySR/pull/506
* fix: `from pysr import *` by MilesCranmer in https://github.com/MilesCranmer/PySR/pull/670


**Full Changelog**: https://github.com/MilesCranmer/PySR/compare/v0.19.0...v0.19.1

0.19.0

What's Changed
* BREAKING: Disable automatic sympy simplification by MilesCranmer in https://github.com/MilesCranmer/PySR/pull/658
* Build: update numpy version by MilesCranmer in https://github.com/MilesCranmer/PySR/pull/650
* Build: bump docker/build-push-action from 5 to 6 by dependabot in https://github.com/MilesCranmer/PySR/pull/652


**Full Changelog**: https://github.com/MilesCranmer/PySR/compare/v0.18.5...v0.19.0

Page 1 of 13

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.