All Projects → MilesCranmer → Pysr

MilesCranmer / Pysr

Licence: apache-2.0
Simple, fast, and parallelized symbolic regression in Python/Julia via regularized evolution and simulated annealing

Programming Languages

python
139335 projects - #7 most used programming language
julia
2034 projects

Projects that are alternatives of or similar to Pysr

Fast Autoaugment
Official Implementation of 'Fast AutoAugment' in PyTorch.
Stars: ✭ 1,297 (+508.92%)
Mutual labels:  automl, distributed
Computational-Intelligence-Tutorials
This is the repository of codes written in class.
Stars: ✭ 36 (-83.1%)
Mutual labels:  numpy, genetic-algorithm
Ray
An open source framework that provides a simple, universal API for building distributed applications. Ray is packaged with RLlib, a scalable reinforcement learning library, and Tune, a scalable hyperparameter tuning library.
Stars: ✭ 18,547 (+8607.51%)
Mutual labels:  automl, distributed
Geneticalgorithmpython
Source code of PyGAD, a Python 3 library for building the genetic algorithm and training machine learning algorithms (Keras & PyTorch).
Stars: ✭ 435 (+104.23%)
Mutual labels:  genetic-algorithm, numpy
Devol
Genetic neural architecture search with Keras
Stars: ✭ 925 (+334.27%)
Mutual labels:  automl, genetic-algorithm
H2o 3
H2O is an Open Source, Distributed, Fast & Scalable Machine Learning Platform: Deep Learning, Gradient Boosting (GBM) & XGBoost, Random Forest, Generalized Linear Modeling (GLM with Elastic Net), K-Means, PCA, Generalized Additive Models (GAM), RuleFit, Support Vector Machine (SVM), Stacked Ensembles, Automatic Machine Learning (AutoML), etc.
Stars: ✭ 5,656 (+2555.4%)
Mutual labels:  automl, distributed
Carefree Learn
A minimal Automatic Machine Learning (AutoML) solution for tabular datasets based on PyTorch
Stars: ✭ 316 (+48.36%)
Mutual labels:  automl, numpy
Mlbox
MLBox is a powerful Automated Machine Learning python library.
Stars: ✭ 1,199 (+462.91%)
Mutual labels:  automl, distributed
Nni
An open source AutoML toolkit for automate machine learning lifecycle, including feature engineering, neural architecture search, model compression and hyper-parameter tuning.
Stars: ✭ 10,698 (+4922.54%)
Mutual labels:  automl, distributed
Lightautoml
LAMA - automatic model creation framework
Stars: ✭ 196 (-7.98%)
Mutual labels:  automl
Flaml
A fast and lightweight AutoML library.
Stars: ✭ 205 (-3.76%)
Mutual labels:  automl
Aimandshoot
A neuroevolution game experiment.
Stars: ✭ 201 (-5.63%)
Mutual labels:  genetic-algorithm
Awkward 1.0
Manipulate JSON-like data with NumPy-like idioms.
Stars: ✭ 203 (-4.69%)
Mutual labels:  numpy
Scannerl
The modular distributed fingerprinting engine
Stars: ✭ 208 (-2.35%)
Mutual labels:  distributed
Alyn
Detect and fix skew in images containing text
Stars: ✭ 202 (-5.16%)
Mutual labels:  numpy
Automlbenchmark
OpenML AutoML Benchmarking Framework
Stars: ✭ 210 (-1.41%)
Mutual labels:  automl
Python Novice Inflammation
Programming with Python
Stars: ✭ 199 (-6.57%)
Mutual labels:  numpy
Voik
♒︎ [WIP] An experimental ~distributed~ commit-log
Stars: ✭ 200 (-6.1%)
Mutual labels:  distributed
Pottery
Redis for humans. 🌎🌍🌏
Stars: ✭ 204 (-4.23%)
Mutual labels:  distributed
Bohrium
Automatic parallelization of Python/NumPy, C, and C++ codes on Linux and MacOSX
Stars: ✭ 209 (-1.88%)
Mutual labels:  numpy

PySR

(pronounced like py as in python, and then sur as in surface)

Documentation Status PyPI version .github/workflows/CI.yml

Parallelized symbolic regression built on Julia, and interfaced by Python. Uses regularized evolution, simulated annealing, and gradient-free optimization.

Cite this software

Documentation

Check out SymbolicRegression.jl for the pure-Julia backend of this package.

Symbolic regression is a very interpretable machine learning algorithm for low-dimensional problems: these tools search equation space to find algebraic relations that approximate a dataset.

One can also extend these approaches to higher-dimensional spaces by using a neural network as proxy, 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 models.

Backstory:

Previously, we have used eureqa, which is a very efficient and user-friendly tool. However, eureqa is GUI-only, doesn't allow for user-defined operators, has no distributed capabilities, and has become proprietary (and recently been merged into an online service). Thus, the goal of this package is to have an open-source symbolic regression tool as efficient as eureqa, while also exposing a configurable python interface.

Installation

PySR uses both Julia and Python, so you need to have both installed.

Install Julia - see downloads, and then instructions for mac and linux. (Don't use the conda-forge version; it doesn't seem to work properly.)

You can install PySR with:

pip install pysr

The first launch will automatically install the Julia packages required.

Quickstart

Here is some demo code (also found in example.py)

import numpy as np
from pysr import pysr, best

# Dataset
X = 2*np.random.randn(100, 5)
y = 2*np.cos(X[:, 3]) + X[:, 0]**2 - 2

# Learn equations
equations = pysr(X, y, niterations=5,
    binary_operators=["plus", "mult"],
    unary_operators=[
      "cos", "exp", "sin", #Pre-defined library of operators (see https://pysr.readthedocs.io/en/latest/docs/operators/)
      "inv(x) = 1/x"]) # Define your own operator! (Julia syntax)

...# (you can use ctl-c to exit early)

print(best(equations))

which gives:

x0**2 + 2.000016*cos(x3) - 1.9999845

One can also use best_tex to get the LaTeX form, or best_callable to get a function you can call. This uses a score which balances complexity and error; however, one can see the full list of equations with:

print(equations)

This is a pandas table, with additional columns:

  • MSE - the mean square error of the formula
  • score - a metric akin to Occam's razor; you should use this to help select the "true" equation.
  • sympy_format - sympy equation.
  • lambda_format - a lambda function for that equation, that you can pass values through.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].