MilesCranmer / PySR

High-Performance Symbolic Regression in Python and Julia
https://astroautomata.com/PySR
Apache License 2.0
2.32k stars 211 forks source link

[Feature]: fixsize #484

Open edfink234 opened 9 months ago

edfink234 commented 9 months ago

Feature Request

Is the user able to fix the size of the generated expressions, or only the max size? If so, can fixsize be added as an optional feature?

MilesCranmer commented 9 months ago

Hey @edfink234,

Only the max size can be specified, as expressions of a particular size need to be iteratively "built up" from smaller expressions.

Cheers, Miles

edfink234 commented 9 months ago

Thank you for the reply. Is there a paper or something where it is documented how the expressions are built in PySR? I was looking through the Julia code yesterday and saw a function that seems to generate a random expression that has a parameter for the length of the expression, here. Could this function in principle be used to generate fixed size expressions, or are they not valid (no rules for appending random ops)?

Sorry if the question is unwelcome 😅.