Replies: 1 comment
-
Hi @AKHCE, PySR stores expressions as binary trees rather than sequences. The struct is defined here: https://github.com/SymbolicML/DynamicExpressions.jl/blob/46388518281b0be12479afcb3a3b8bdabc361ccd/src/Equation.jl#L57 Technically as of MilesCranmer/SymbolicRegression.jl#135, expressions are actually stored as acyclic graphs — which can let you have multiple parent nodes for a single child. That means you could in theory share a subexpression across an expression. However relevant utilities for that are not set up yet. I’d be interested to know if you have any ideas for exploiting graph theory. Cheers, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
My assumption is PySR converts equations into trees by using sequence-based list. For example, for equation 2*x+1, the tree is represented by a list like [+, 1, *, 2, x]. Did I get it correctly?
I am curious to know if you could conceive any benefit of using graph presentation of equations instead of using trees (i.e. sequence-based list). The reason I am bringing this up is that there is a rich history of graph theory, which might contribute to search engine.
Thank you so much in advance for sharing your thoughts,
Cheers
Beta Was this translation helpful? Give feedback.
All reactions