Open FelixSchloms opened 2 months ago
This is a known incompatibility between the older PyCall.jl (which SymPy.jl still uses) and PythonCall.jl (which PySR has upgraded to). The fix is to call sympy directly using PythonCall. See https://juliapy.github.io/PythonCall.jl/stable/pythoncall/ for the docs.
I would also recommend using SymbolicUtils.jl instead of SymPy, which SymbolicRegression.jl has a built-in converter to. It will be MUCH faster. SymPy will be extremely slow.
Thank you for your quick reply. However, as far as I understand it correctly, the SymbolicUtils doesnt provide the possibilty to solve an equation for a different variable. But Symbolics.jl can with its latest version, which seems not be compatible with SymbolicRegression.jl. Adding SymbolicRegression.jl downgrades Symbolics.jl from 6.11 to 5.28, which doesnt provide this functionality of solving symbolic equations for different variables. Is there any possibility to get the functionality of solving an equation for different variables within the loss function of the SymbolicRegression.jl?
Symbolics.jl is a front end for SymbolicUtils.jl. They’re the same though
oh okay, I didnt notice. I am still confused why the Symbolics.jl front end, which seems much easier to handle for me, doesnt work in its latest version with the SymbolicRegression.jl?
It’s because I haven’t updated the version compatibility for SymbolicUtils yet. This PR needs to merge first: https://github.com/MilesCranmer/SymbolicRegression.jl/pull/326
What happened?
I am working on an invertible symbolic regression task using
SymPy
in Julia. The goal is to obtain a symbolic expression that can be accurately expressed in each of the used variables. I was usingSymPy
to evaluate the performance of the found expression, even when solving for different variables.My loss function isolated works as intended when using it directly with a tree, dataset, and options. However, when I attempt to use this same loss function in the
SRRegressor
, the Julia process crashes unexpectedly, and the console quits with an error.Version
0.0.0
Operating System
Windows
Interface
Julia REPL
Relevant log output
Extra Info
MWE which should reproduce the error: