PySR is an open-source symbolic regression library that uses a Julia-based evolutionary search engine to discover interpretable symbolic expressions that fit data. It targets low-dimensional problems directly and supports "symbolic distillation" to extract analytic formulas from neural networks for higher-dimensional tasks. The interface follows scikit-learn conventions via PySRRegressor, producing a ranked hall of fame of candidate equations with scores, loss, and complexity. Discovered formulas are exported in multiple callable formats (plain lambda, SymPy) and in differentiable forms for JAX and PyTorch, enabling further analysis, differentiation, or integration into pipelines. Warm-started searches, model selection, and an explicit equation table let users inspect, select, and reuse prior search state.
Installation and deployment are straightforward via pip or conda, with Docker and Apptainer recipes for containerized or cluster use. The search is highly configurable: populations, population_size, niterations, ncycles_per_iteration, timeout and early_stop rules, maxsize/maxdepth, custom binary/unary operators, per-operator constraints and nested constraints. Practical features include denoising, feature selection, saving/loading hall_of_fame CSV/PKL, and a from_file loader. Troubleshooting notes cover common binary library conflicts (GLIBCXX) and fixing LD_LIBRARY_PATH to Julia libraries. Documentation, examples, and an arXiv citation (2305.01582) accompany the project for deeper study.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.