Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Bingo Logo

master: Build Status

develop: Build Status

Description

Bingo is an open source package for performing symbolic regression, though it can be used as a general purpose evolutionary optimization package.

Key Features

  • Expression-specific symbolic-regression fitting
  • Parallel island evolution strategy implemented with mpi4py
  • Coevolution of fitness predictors

Quick Start

Documentation

Full Documentation Here

Installation

pip install bingo-nasa

Parallel island evolution requires the MPI extra:

pip install "bingo-nasa[MPI]"

Usage Example

A no-fuss way of using Bingo is by using the scikit-learn wrapper: SymbolicRegressor. Let's setup a test case to show how it works.

Setting Up the Regressor

Configure SymbolicRegressor with its population size, minimum and maximum expression stack sizes, and simplification mode. The estimator uses Expression-native generation, fitting, and loss evaluation. See the migration guide for the current public API. Evolution minimizes loss, while Expression scores are higher-is-better. Legacy AGraph/Equation checkpoints are not compatible with the Expression API.

from bingo.symbolic_regression import SymbolicRegressor
regressor = SymbolicRegressor(
    population_size=100,
    min_stack_size=8,
    max_stack_size=16,
    simplification="cas",
)

Training Data

Here we're just creating some dummy training data from the equation $5.0 X_0^2 + 3.5 X_0$. More on training data can be found in the data formatting guide.

import numpy as np
X_0 = np.linspace(-10, 10, num=30).reshape((-1, 1))
X = np.array(X_0)
y = (5.0 * X_0 ** 2 + 3.5 * X_0).ravel()
import matplotlib.pyplot as plt
plt.scatter(X, y)
plt.xlabel("X_0")
plt.ylabel("y")
plt.title("Training Data")
plt.show()

png

Fitting the Regressor

Fitting is as simple as calling the .fit() method.

regressor.fit(X, y)

Getting the Best Individual

best_individual = regressor.get_best_individual()
print("best individual is:", best_individual)
best individual is: X_0 + (5.0)((0.4999999999999999)(X_0) + (X_0)(X_0))

Predicting Data with the Best Individual

You can use the regressor's .predict(X) or the best individual's .predict(X) to get predictions for X.

pred_y = regressor.predict(X)
pred_y = best_individual.predict(X)

plt.scatter(X, y)
plt.plot(X, pred_y, 'r')
plt.xlabel("X_0")
plt.ylabel("y")
plt.legend(["Actual", "Predicted"])
plt.show()

png

Source

Installation from Source

For those looking to develop their own features in Bingo.

First clone the repo and move into the directory:

git clone https://github.com/nasa/bingo.git
cd bingo

Then make sure you have the requirements necessary to use Bingo:

conda env create -f conda_environment.yml

or

pip install -r requirements.txt

The source-checkout requirements include MPI support for development and the full test suite. To install only the parallel capability from a package release, use pip install "bingo-nasa[MPI]".

(Optional) Build the C++ expression backend:

./.build_cppagraph.sh

Now you should be good to go! You can run Bingo's test suite to make sure that the installation process worked properly:

pytest tests

Add Bingo to your Python path to begin using it from other directories.

export PYTHONPATH="$PYTHONPATH:/path/to/bingo/"

and test it with:

python -c 'import bingo; from bingo.expressions import AGraphExpression'

Contributing

  1. Fork it (https://github.com/nasa/bingo/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

Citing Bingo

Please consider citing the following reference when using bingo in your works.

MLA:

Randall, David L., et al. "Bingo: a customizable framework for symbolic regression with genetic programming." Proceedings of the Genetic and Evolutionary Computation Conference Companion. 2022.

Bibtex:

@inproceedings{randall2022bingo,
  title={Bingo: a customizable framework for symbolic regression with genetic programming},
  author={Randall, David L and Townsend, Tyler S and Hochhalter, Jacob D and Bomarito, Geoffrey F},
  booktitle={Proceedings of the Genetic and Evolutionary Computation Conference Companion},
  pages={2282--2288},
  year={2022}
}

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

  • Geoffrey Bomarito
  • Tyler Townsend
  • Jacob Hochhalter
  • David Randall
  • Ethan Adams
  • Kathryn Esham
  • Diana Vera

License

Copyright 2018 United States Government as represented by the Administrator of the National Aeronautics and Space Administration. No copyright is claimed in the United States under Title 17, U.S. Code. All Other Rights Reserved.

The Bingo Mini-app framework is licensed under the Apache License, Version 2.0 (the "License"); you may not use this application except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 .

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bingo_nasa-0.6.0rc1.tar.gz (398.0 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

bingo_nasa-0.6.0rc1-cp314-cp314-musllinux_1_2_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.14musllinux: musl 1.2+ x86-64

bingo_nasa-0.6.0rc1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (616.7 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

bingo_nasa-0.6.0rc1-cp313-cp313-musllinux_1_2_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

bingo_nasa-0.6.0rc1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (616.6 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

bingo_nasa-0.6.0rc1-cp312-cp312-musllinux_1_2_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

bingo_nasa-0.6.0rc1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (616.6 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

bingo_nasa-0.6.0rc1-cp311-cp311-musllinux_1_2_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

bingo_nasa-0.6.0rc1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (613.8 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

File details

Details for the file bingo_nasa-0.6.0rc1.tar.gz.

File metadata

  • Download URL: bingo_nasa-0.6.0rc1.tar.gz
  • Upload date:
  • Size: 398.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for bingo_nasa-0.6.0rc1.tar.gz
Algorithm Hash digest
SHA256 3aba02b028c0c30e54e37fafef506e6bbf6fa8f2f3dede47cc387cff5c8bc486
MD5 4b8f3c55c7fe94315989e874a2f5c2d6
BLAKE2b-256 92102ae83af1698538681809e16b9e703fe42ddd9e747b4d00fb34f0caf5875b

See more details on using hashes here.

Provenance

The following attestation bundles were made for bingo_nasa-0.6.0rc1.tar.gz:

Publisher: pypi.yml on nasa/bingo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bingo_nasa-0.6.0rc1-cp314-cp314-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for bingo_nasa-0.6.0rc1-cp314-cp314-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 bdf02f29db15328fee7e78721e93fe5cabf620301f42a22c017f029abd3f1e36
MD5 cc9f88eed3c8e1808dd5aef0e3d693c3
BLAKE2b-256 6b6613e2c4c00982002e83cfa790c8efb7b143711e470a88d3f6ecf09639f3bb

See more details on using hashes here.

Provenance

The following attestation bundles were made for bingo_nasa-0.6.0rc1-cp314-cp314-musllinux_1_2_x86_64.whl:

Publisher: pypi.yml on nasa/bingo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bingo_nasa-0.6.0rc1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for bingo_nasa-0.6.0rc1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1d5017eb1f95f0d73a1b3e66076d3ba0a901be6e206d673f94c45587182bcffe
MD5 0f3fb496b2f61b0ab1b9c8a94d29eee9
BLAKE2b-256 74e51e9598a56f5ed9a65df3466bc1a70a735122a1bccf419aaa111e417b3471

See more details on using hashes here.

Provenance

The following attestation bundles were made for bingo_nasa-0.6.0rc1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: pypi.yml on nasa/bingo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bingo_nasa-0.6.0rc1-cp313-cp313-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for bingo_nasa-0.6.0rc1-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 af4ba07cc04d1ec1f1d526109c6db54a4e9205ea6a087d787050c22bda347e0e
MD5 41f67fa4092265dea5700bb50e54f8b6
BLAKE2b-256 688b6f5a50a420a5137766d940ea99ed812157b17cf9d11e009f5ac7b8fa7368

See more details on using hashes here.

Provenance

The following attestation bundles were made for bingo_nasa-0.6.0rc1-cp313-cp313-musllinux_1_2_x86_64.whl:

Publisher: pypi.yml on nasa/bingo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bingo_nasa-0.6.0rc1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for bingo_nasa-0.6.0rc1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d89b098e743e066c6170780deac6ebf92df2a10bc6b221a6d60b0fc5e14088a2
MD5 6b8df47f9447870d958df7f8a4cc7e1b
BLAKE2b-256 f828101da33216a78f2ea6aa4567a36cdd441f3b0bdd3083ffac8deffa415817

See more details on using hashes here.

Provenance

The following attestation bundles were made for bingo_nasa-0.6.0rc1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: pypi.yml on nasa/bingo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bingo_nasa-0.6.0rc1-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for bingo_nasa-0.6.0rc1-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 49526f7d22a0f0e61b0c23d7a1d65b2509032273ddaff2c4e2ebd6e7dc083d0e
MD5 fc47d2a017b8a233ed51a39307b9943e
BLAKE2b-256 1cd2a59e3972ab154582a8646149e201cd614f85cccad55ea839881534714be5

See more details on using hashes here.

Provenance

The following attestation bundles were made for bingo_nasa-0.6.0rc1-cp312-cp312-musllinux_1_2_x86_64.whl:

Publisher: pypi.yml on nasa/bingo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bingo_nasa-0.6.0rc1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for bingo_nasa-0.6.0rc1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d9cea5ffbee7b805f43a3954b611470435d01adea0d649b2422a825801fd304d
MD5 1ecd22b968cb4dd96a25a2440d1ecf38
BLAKE2b-256 80ad520bfd260954ed818f340f9c4fd4a9a64167b79c5e77cb1254306fa914c9

See more details on using hashes here.

Provenance

The following attestation bundles were made for bingo_nasa-0.6.0rc1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: pypi.yml on nasa/bingo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bingo_nasa-0.6.0rc1-cp311-cp311-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for bingo_nasa-0.6.0rc1-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 6e715c8387f8fb82ae94dd6ce2682daca5585214deecb352708791ffbdd1f2dc
MD5 0d8a897ecf490bb8911164cb30d9b7f6
BLAKE2b-256 ab6445a85b7bd6f8667a8a0819f4e6ad371aacd3a04e84f9af9befff40653e94

See more details on using hashes here.

Provenance

The following attestation bundles were made for bingo_nasa-0.6.0rc1-cp311-cp311-musllinux_1_2_x86_64.whl:

Publisher: pypi.yml on nasa/bingo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bingo_nasa-0.6.0rc1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for bingo_nasa-0.6.0rc1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 733cc3233b0eee38797f1f75335c68e5ba01181a58c4dbe1bca41f808d5b0e42
MD5 2c4cddb663767a42f8efd148f65d7002
BLAKE2b-256 139bbc2694fb2521f2f5546f6a99f8278d47b1b8e80e4c0e63ea7f3e1f1df50a

See more details on using hashes here.

Provenance

The following attestation bundles were made for bingo_nasa-0.6.0rc1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: pypi.yml on nasa/bingo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.6.0rc1 This release

9 files

0.5.7

11 files

0.5.6

11 files

0.5.5

21 files

0.5.4

21 files

0.5.2

21 files

0.5.1

21 files

0.5.0

21 files

0.4.1

1 file

0.4.0

1 file

0.3.1

1 file

0.3.0

1 file

0.2.2

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page