MilesCranmer / PySR

High-Performance Symbolic Regression in Python and Julia
https://ai.damtp.cam.ac.uk/pysr
Apache License 2.0
2.44k stars 217 forks source link

Let sympy use log2(x) instead of log(x)/log(2) #711

Open MilesCranmer opened 2 months ago

MilesCranmer commented 2 months ago

Discussed in https://github.com/MilesCranmer/PySR/discussions/710

Originally posted by **nerai** September 3, 2024 The export to sympy currently translates log2(x) to log(x)/log(2). This is cumbersome if log2 is commonly used and makes the equations hard to read. Sympy supports log2 natively, so I feel it would be appropriate to also translate log2 into that instead. It is perhaps possible to only fix the output in sympy, but ideally, it should be done in PySR directly.
MilesCranmer commented 2 months ago

@nerai

MilesCranmer commented 2 months ago

I'm totally on board with this, just busy lately. If you want to make a PR I can merge it!