Restricting constants to be integral (or even just sampled from a finite set) #306
Replies: 0 comments 4 replies
-
Hey Alun, Thanks for posting this, I am happy that the package has been useful to you! This is a fantastic question! I agree this would be very nice to have implemented. Regarding having user-defined The other option is to have real numbers and integers both implemented. However, since PySR/SymbolicRegression.jl assume complexity=sum of operators, variables, constants, currently it would not be an advantage for an expression to have an integer instead of a real number, so I think it would preferentially find reals. Therefore changing Interested to hear your thoughts. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Hey!
First off, just wanted to say great job with the package, it's been quite helpful to me.
I'm trying to come up with equations that allow for constants, but am really only interested in integral constants (in particular, restriciting to integers with absolute value less than some bound). I was wondering there's some method I'm missing to enact this, or if it's impossible as is. Funnily, what I have seen is the evolution of the subtree Equals(a, a) in place of what should be a 1, but this is obviously unideal.
Just from a cursory look about, it seems that allowing CONST_TYPE to be a user-defined parameter (+ adding a parameter for eg. a list of desired values), and then selecting the update strategy in ConstantOptimization.jl based on CONST_TYPE being a subtype of Float v. Int type is a solution I coud implement -- but if you've an idea of a better way I'd love to get your input.
Best,
Alun
Beta Was this translation helpful? Give feedback.
All reactions