astroautomata / PySR
git clone https://github.com/astroautomata/PySR.git
v2.7.2 · 2d ago
Symbolic Learning in Python and Julia
+11
stars, 24h · #1,305
+~77
stars, 7 days · #1,631
+~330
stars, 30 days · #1,586
4.1k
★ total · +2% this week
380
forks · 140 open issues
Star history (as recorded here)
LanguagePython
LicenseApache-2.0
Created2020-09-14 (6y ago)
Last push1d ago
Watchers31
OwnerOrganization
GitHub topics
algorithmautomldata-sciencedistributed-systemsequation-discoveryevolutionary-algorithmsexplainable-aigenetic-algorithminterpretable-mljuliamachine-learningpythonscikit-learnsymbolicsymbolic-regression
Links
- GitHub: github.com/astroautomata/PySR
- Homepage: https://pysr.ai
- Releases · Issues · Hacker News mentions
README excerpt
PySR Symbolic Regression in Python and Julia Docs × Examples × API × Forum × Agents [code] If you find PySR useful, please cite the paper arXiv:2305.01582. If you've finished a project with PySR, please submit a PR to showcase your work on the research showcase page! **Contents**: - Why PySR? - Installation - Quickstart - → Documentation - Contributors ## Why PySR? PySR is an open-source tool for *Symbolic Regression*: a machine learning task where the goal is to find an interpretable symbolic expression that optimizes some objective. Over a period of several years, PySR has been engineered from the ground up to be (1) as high-performance as possible, (2) as configurable as possible, and (3) easy to use. PySR is developed alongside the Julia library SymbolicRegression.jl, which forms the powerful search engine of PySR. The details of these algorithms are described in the PySR paper. Symbolic regression works best on low-dimensional datasets, but one can also extend these approaches to higher-dimensional spaces by using "*Symbolic Distillation*" of Neural Networks, as explained in 2006.11287, where we apply it to N-body problems. Here, one essentially uses symbolic regression to convert a neural net to an analytic equation. Thus, these tools simultaneously present an explicit and powerful way to interpret deep neural networks. ## Installation You can install PySR with pip or conda: [code] [code] Julia dependencies will be installed at first import. ### AI Agent Skill Install the PySR skill to provide your coding agents guidance using PySR as part of a larger agentic loop: [code] Add `--global` to install the skill globally. ### Docker You can also use the `Dockerfile` to install PySR in a docker container 1. Clone this repo. 2. Within the repo's directory, build the docker container: [code] 3. You can then start the container with an IPython execution with: [code] For more details, see the docker section. ### Apptainer If you are using PySR on a cluster where you do not have root access, you can use Apptainer to build a container instead of Docker. The `Apptainer.def` file is analogous to the `Dockerfile`, and can be built with: [code] and launched with [code] ### Troubleshooting One issue you might run into can result in a hard crash at import with a message like "`GLIBCXX_...` not found". This is due to another one of the Python dependencies loading an incorrect `libstdc++` library. To fix this, you should modify your `LD_LIBRARY_PATH` variable to reference the Julia libraries. For example, if the Julia version of `libstdc++.so` is located in `$HOME/.julia/juliaup/julia-1.10.0+0.x64.linux.gnu/lib/julia/` (which likely differs on your system!), you could add: [code] to your `.bashrc` or `.zshrc` file. ## Quickstart You might wish to try the interactive tutorial here, which uses the notebook in `examples/pysr_demo.ipynb`. In practice, I highly recommend using IPython rather than Jupyter, as the printing is much nicer. Be