--- id: pysr version: "1.5.10" license: Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for… (full text in the JSON record) license_treatment: permissive maintenance: active --- # pysr — Simple and efficient symbolic regression License: permissive · Maintenance: active · Downloads: 98.8K/mo ## What it is and what it does PySR is a symbolic regression tool that discovers interpretable mathematical expressions fitting your data. Instead of returning a neural network or opaque model, it uses evolutionary search powered by Julia to explore the space of possible equations, combining operators like addition, multiplication, and functions like cosine or exponential. It follows scikit-learn's fit/predict interface, making it familiar to data scientists while offering something fundamentally different: equations you can read, understand, and use analytically. The package is designed for low-dimensional datasets where interpretability matters more than squeezing out the last percentage point of accuracy. It also supports symbolic distillation—converting trained neural networks into analytic equations—which can help explain deep learning models. Configuration is extensive: you define which operators to search, custom loss functions, complexity penalties, and iteration counts, giving you fine control over the search process. Use it for: - Discover interpretable formulas from experimental physics or chemistry data where understanding the equation matters as much as prediction. - Convert a trained neural network into a symbolic equation for scientific interpretation or deployment in resource-constrained environments. - Fit low-dimensional datasets where you suspect a simple closed-form relationship exists but don't know its structure. - Generate candidate equations for hypothesis testing in scientific research where the model itself is the research output. - Reduce model complexity and improve generalization by finding sparse, parsimonious expressions instead of high-degree polynomials. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. PySR searches for symbolic expressions that fit data by combining genetic algorithms with Julia's performance, returning human-readable equations instead of black-box models. Yes, if you work with low-dimensional data where interpretability is a priority or you need to extract equations from neural networks. The active maintenance, permissive license, low install friction, and scikit-learn-compatible interface make it a solid choice. Not recommended if you need black-box performance on high-dimensional datasets or require guaranteed convergence to a global optimum. ## Install pip install pysr uv add pysr poetry add pysr ## Installing pysr Before you install: Low friction install with a pure Python wheel; Julia dependencies install automatically on first import. Actively maintained with recent releases. License in practice: Apache 2.0 permissive license allows commercial and private use with minimal restrictions; you may modify and distribute derivative works provided you include license notices. Quickstart: pip install pysr import numpy as np from pysr import PySRRegressor X = np.random.randn(100, 5) y = 2.5 * np.cos(X[:, 3]) + X[:, 0] ** 2 model = PySRRegressor(maxsize=20, niterations=40, binary_operators=["+", "*"], unary_operators=["cos", "sin"]) model.fit(X, y) print(model.predict(X)) Requires Julia to be installed or will download it on first import; LD_LIBRARY_PATH conflicts with other Python packages loading libstdc++ may require manual configuration. Verify before relying: - Whether the package handles datasets larger than typical low-dimensional symbolic regression benchmarks without significant performance degradation. - Specific performance characteristics or memory requirements for typical use cases. - Whether custom loss functions and operators are fully documented and stable across versions. ## Package facts - License: Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for… (full text in the JSON record) (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 98.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags symbolic regression, equation discovery, interpretable machine learning, genetic algorithm fitting, symbolic distillation neural networks, formula fitting, expression search, symbolic-regression, interpretable-ml, equation-discovery [View on SkillFed](https://skillfed.io/packages/pysr) · [View on PyPI](https://pypi.org/project/pysr/)