Pysr

Latest version: v1.5.3

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

Scan your dependencies

Page 1 of 14

1.5.3

What's Changed
* fix: change sympy mappings ordering by romanovzky in https://github.com/MilesCranmer/PySR/pull/868

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

**Full Changelog**: https://github.com/MilesCranmer/PySR/compare/v1.5.2...v1.5.3

1.5.2

What's Changed
* fix: mapping of cbrt by MilesCranmer in https://github.com/MilesCranmer/PySR/pull/858


**Full Changelog**: https://github.com/MilesCranmer/PySR/compare/v1.5.1...v1.5.2

1.5.1

What's Changed
* fix: comparison operator parsing by MilesCranmer in https://github.com/MilesCranmer/PySR/pull/845


**Full Changelog**: https://github.com/MilesCranmer/PySR/compare/v1.5.0...v1.5.1

1.5.0

Backend Changes

Major Changes

* Change behavior of batching to resample only every iteration; not every eval in https://github.com/MilesCranmer/SymbolicRegression.jl/pull/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 <: Dataset` rather than passing around an array `idx` explicitly.
* Note that other than the slight behaviour change, this is otherwise backwards compatible - the old way to write custom loss functions that take `idx` will still be handled.

Other changes

* feat: better error for mismatched eltypes by MilesCranmer in https://github.com/MilesCranmer/SymbolicRegression.jl/pull/414
* CompatHelper: bump compat for Optim to 1, (keep existing compat) by github-actions in https://github.com/MilesCranmer/SymbolicRegression.jl/pull/403
* feat: explicitly monitor errors in workers by MilesCranmer in https://github.com/MilesCranmer/SymbolicRegression.jl/pull/417
* feat: allow recording crossovers by MilesCranmer in https://github.com/MilesCranmer/SymbolicRegression.jl/pull/415
* add script for converting record to graphml by MilesCranmer in https://github.com/MilesCranmer/SymbolicRegression.jl/pull/416
* ci: redistribute part 1 of test suite by MilesCranmer in https://github.com/MilesCranmer/SymbolicRegression.jl/pull/424
* refactor: rename to `.cost` by MilesCranmer in https://github.com/MilesCranmer/SymbolicRegression.jl/pull/423
* fix: batched dataset for optimisation by MilesCranmer in https://github.com/MilesCranmer/SymbolicRegression.jl/pull/426
* refactor: task local storage instead of thread local by MilesCranmer in https://github.com/MilesCranmer/SymbolicRegression.jl/pull/427

Frontend Changes

* Update backend to v1.8.0 by MilesCranmer in https://github.com/MilesCranmer/PySR/pull/833
* test: update deprecated sklearn test syntax by MilesCranmer in https://github.com/MilesCranmer/PySR/pull/834
* chore(deps): bump juliacall from 0.9.23 to 0.9.24 by dependabot in https://github.com/MilesCranmer/PySR/pull/815
* use standard library logging by MilesCranmer in https://github.com/MilesCranmer/PySR/pull/835
* Remove warning about many features, as not really relevant anymore by MilesCranmer in https://github.com/MilesCranmer/PySR/pull/837
* chore(deps): update beartype requirement from <0.20,>=0.19 to >=0.19,<0.21 by dependabot in https://github.com/MilesCranmer/PySR/pull/838
* chore(deps): update jax[cpu] requirement from <0.5,>=0.4 to >=0.4,<0.6 by dependabot in https://github.com/MilesCranmer/PySR/pull/810


**Full Changelog**: https://github.com/MilesCranmer/PySR/compare/v1.4.0...v1.5.0

1.4.0

What's Changed

[823](https://github.com/MilesCranmer/PySR/pull/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).

python
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 $y = p_1 + p_2 f(x) + p_3 f(x)^2.$

You can have multiple parameter vectors, and these parameter vectors can also be indexed by categorical features. For example:

python
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:
$$y = \alpha_c\,f(x_1,x_2) + \beta g(x_1 ^2)$$
where $c$ is the category, $\alpha_c$ is a learned parameter specific to each category, and $\beta$ is a normal scalar category. Note that **unlike ParametricExpressionSpec**, this feature of TemplateExpressionSpec would have you pass the `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:

python
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](https://github.com/MilesCranmer/PySR/compare/v1.3.1...v1.4.0)

1.3.1

What's Changed
* Automated update to backend: v1.5.1 by github-actions in https://github.com/MilesCranmer/PySR/pull/790


**Full Changelog**: https://github.com/MilesCranmer/PySR/compare/v1.3.0...v1.3.1

Page 1 of 14

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.