This release is a pre-release and may not be stable for production use.
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
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()
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()
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
- Fork it (https://github.com/nasa/bingo/fork)
- Create your feature branch (
git checkout -b feature/fooBar) - Commit your changes (
git commit -am 'Add some fooBar') - Push to the branch (
git push origin feature/fooBar) - 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
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bingo_nasa-0.6.0rc2.tar.gz.
File metadata
- Download URL: bingo_nasa-0.6.0rc2.tar.gz
- Upload date:
- Size: 398.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
265ce8ea5f41438c780f0ce42fc008c78a1247b59083d2986eefd2e83615bdf5
|
|
| MD5 |
1efe5d5254df5ba09ae98eb7476b1879
|
|
| BLAKE2b-256 |
b2ac8434a239872f14d38934b37256bb5ff0e150be44787769f1fffa96ad91b7
|
Provenance
The following attestation bundles were made for bingo_nasa-0.6.0rc2.tar.gz:
Publisher:
pypi.yml on nasa/bingo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bingo_nasa-0.6.0rc2.tar.gz -
Subject digest:
265ce8ea5f41438c780f0ce42fc008c78a1247b59083d2986eefd2e83615bdf5 - Sigstore transparency entry: 2467568463
- Sigstore integration time:
-
Permalink:
nasa/bingo@1c4a921c7d307ac160ceaf3c70517b1c19f4acbf -
Branch / Tag:
refs/tags/0.6.0rc2 - Owner: https://github.com/nasa
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@1c4a921c7d307ac160ceaf3c70517b1c19f4acbf -
Trigger Event:
push
-
Statement type:
File details
Details for the file bingo_nasa-0.6.0rc2-cp314-cp314-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: bingo_nasa-0.6.0rc2-cp314-cp314-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 1.7 MB
- Tags: CPython 3.14, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b815c8fe38b61ec980d71bd37cb23030b903b25c1402725601fbf105484f1dcb
|
|
| MD5 |
bed05b8f6453891974f96c459cd1a6e7
|
|
| BLAKE2b-256 |
bc1c3d130483f82069b4db816dbe965aa49925fb8591dd6c57adfe875a43a218
|
Provenance
The following attestation bundles were made for bingo_nasa-0.6.0rc2-cp314-cp314-musllinux_1_2_x86_64.whl:
Publisher:
pypi.yml on nasa/bingo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bingo_nasa-0.6.0rc2-cp314-cp314-musllinux_1_2_x86_64.whl -
Subject digest:
b815c8fe38b61ec980d71bd37cb23030b903b25c1402725601fbf105484f1dcb - Sigstore transparency entry: 2467568647
- Sigstore integration time:
-
Permalink:
nasa/bingo@1c4a921c7d307ac160ceaf3c70517b1c19f4acbf -
Branch / Tag:
refs/tags/0.6.0rc2 - Owner: https://github.com/nasa
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@1c4a921c7d307ac160ceaf3c70517b1c19f4acbf -
Trigger Event:
push
-
Statement type:
File details
Details for the file bingo_nasa-0.6.0rc2-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: bingo_nasa-0.6.0rc2-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 616.7 kB
- Tags: CPython 3.14, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb38a2418eadf975b0ee18f74a21cccffa4eaf28f70f4b052d8060bc6e4d56ef
|
|
| MD5 |
f2a8ec5ed6459fab117070e250d832f4
|
|
| BLAKE2b-256 |
4c3bde71c3acca5a6342ef4e1f5c72cdda8c16af4d090192afd9d0cb4fd7e705
|
Provenance
The following attestation bundles were made for bingo_nasa-0.6.0rc2-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
pypi.yml on nasa/bingo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bingo_nasa-0.6.0rc2-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
fb38a2418eadf975b0ee18f74a21cccffa4eaf28f70f4b052d8060bc6e4d56ef - Sigstore transparency entry: 2467568838
- Sigstore integration time:
-
Permalink:
nasa/bingo@1c4a921c7d307ac160ceaf3c70517b1c19f4acbf -
Branch / Tag:
refs/tags/0.6.0rc2 - Owner: https://github.com/nasa
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@1c4a921c7d307ac160ceaf3c70517b1c19f4acbf -
Trigger Event:
push
-
Statement type:
File details
Details for the file bingo_nasa-0.6.0rc2-cp313-cp313-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: bingo_nasa-0.6.0rc2-cp313-cp313-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 1.7 MB
- Tags: CPython 3.13, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5593c408d73729b7a4d47ff0c9773564645f1fe3134d33872fae1e1092e381e0
|
|
| MD5 |
b30d2dd9bef3a7d4f401741cd83175a7
|
|
| BLAKE2b-256 |
16e2673a6ad2b6113c74611a2e1774e7b4fd0db23ce6553a86cc27b414237f88
|
Provenance
The following attestation bundles were made for bingo_nasa-0.6.0rc2-cp313-cp313-musllinux_1_2_x86_64.whl:
Publisher:
pypi.yml on nasa/bingo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bingo_nasa-0.6.0rc2-cp313-cp313-musllinux_1_2_x86_64.whl -
Subject digest:
5593c408d73729b7a4d47ff0c9773564645f1fe3134d33872fae1e1092e381e0 - Sigstore transparency entry: 2467568617
- Sigstore integration time:
-
Permalink:
nasa/bingo@1c4a921c7d307ac160ceaf3c70517b1c19f4acbf -
Branch / Tag:
refs/tags/0.6.0rc2 - Owner: https://github.com/nasa
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@1c4a921c7d307ac160ceaf3c70517b1c19f4acbf -
Trigger Event:
push
-
Statement type:
File details
Details for the file bingo_nasa-0.6.0rc2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: bingo_nasa-0.6.0rc2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 616.6 kB
- Tags: CPython 3.13, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd93f12a0603f6cfb0972d1d61b4c5e01b06770cc64d796ba238951c4087bc9b
|
|
| MD5 |
fc86779029731709f5e1eb064aa10618
|
|
| BLAKE2b-256 |
ba644080cad30939ddd4ffba8602bcf6abcfa5a11ae19c5ca259804547d9b61b
|
Provenance
The following attestation bundles were made for bingo_nasa-0.6.0rc2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
pypi.yml on nasa/bingo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bingo_nasa-0.6.0rc2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
cd93f12a0603f6cfb0972d1d61b4c5e01b06770cc64d796ba238951c4087bc9b - Sigstore transparency entry: 2467568559
- Sigstore integration time:
-
Permalink:
nasa/bingo@1c4a921c7d307ac160ceaf3c70517b1c19f4acbf -
Branch / Tag:
refs/tags/0.6.0rc2 - Owner: https://github.com/nasa
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@1c4a921c7d307ac160ceaf3c70517b1c19f4acbf -
Trigger Event:
push
-
Statement type:
File details
Details for the file bingo_nasa-0.6.0rc2-cp312-cp312-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: bingo_nasa-0.6.0rc2-cp312-cp312-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 1.7 MB
- Tags: CPython 3.12, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
82f9d1317e83ad1f46da20951ed526fe826292d98835b703802ec2bdc1ae2f01
|
|
| MD5 |
c6ccdf3787a506cce1a6a294b2d9ce44
|
|
| BLAKE2b-256 |
a7bbe58c4d06eda42884c44422702bd642a2d07c01315da7390a0b1612a097e0
|
Provenance
The following attestation bundles were made for bingo_nasa-0.6.0rc2-cp312-cp312-musllinux_1_2_x86_64.whl:
Publisher:
pypi.yml on nasa/bingo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bingo_nasa-0.6.0rc2-cp312-cp312-musllinux_1_2_x86_64.whl -
Subject digest:
82f9d1317e83ad1f46da20951ed526fe826292d98835b703802ec2bdc1ae2f01 - Sigstore transparency entry: 2467568691
- Sigstore integration time:
-
Permalink:
nasa/bingo@1c4a921c7d307ac160ceaf3c70517b1c19f4acbf -
Branch / Tag:
refs/tags/0.6.0rc2 - Owner: https://github.com/nasa
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@1c4a921c7d307ac160ceaf3c70517b1c19f4acbf -
Trigger Event:
push
-
Statement type:
File details
Details for the file bingo_nasa-0.6.0rc2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: bingo_nasa-0.6.0rc2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 616.6 kB
- Tags: CPython 3.12, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
82486a24af2763af302c900038b6ad21fc79451e6747e9bf37b416deebb1f036
|
|
| MD5 |
05b7dd9b87ee3873fdd93f2b4cd9235e
|
|
| BLAKE2b-256 |
d0adb6ef81a246652e11a377b9c340536e3847ec592c229f2e05dadada0126ea
|
Provenance
The following attestation bundles were made for bingo_nasa-0.6.0rc2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
pypi.yml on nasa/bingo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bingo_nasa-0.6.0rc2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
82486a24af2763af302c900038b6ad21fc79451e6747e9bf37b416deebb1f036 - Sigstore transparency entry: 2467568790
- Sigstore integration time:
-
Permalink:
nasa/bingo@1c4a921c7d307ac160ceaf3c70517b1c19f4acbf -
Branch / Tag:
refs/tags/0.6.0rc2 - Owner: https://github.com/nasa
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@1c4a921c7d307ac160ceaf3c70517b1c19f4acbf -
Trigger Event:
push
-
Statement type:
File details
Details for the file bingo_nasa-0.6.0rc2-cp311-cp311-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: bingo_nasa-0.6.0rc2-cp311-cp311-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 1.7 MB
- Tags: CPython 3.11, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ca9b9b8a109f75ad3e475caa37e16a177e4f4606191c59668e439939624cfd87
|
|
| MD5 |
8aab609098d6933b7e18374f7b9994b9
|
|
| BLAKE2b-256 |
5f7a8f76ba249dc71dc70aaadb6c08c8dae7db568093713a57485983011d602f
|
Provenance
The following attestation bundles were made for bingo_nasa-0.6.0rc2-cp311-cp311-musllinux_1_2_x86_64.whl:
Publisher:
pypi.yml on nasa/bingo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bingo_nasa-0.6.0rc2-cp311-cp311-musllinux_1_2_x86_64.whl -
Subject digest:
ca9b9b8a109f75ad3e475caa37e16a177e4f4606191c59668e439939624cfd87 - Sigstore transparency entry: 2467568499
- Sigstore integration time:
-
Permalink:
nasa/bingo@1c4a921c7d307ac160ceaf3c70517b1c19f4acbf -
Branch / Tag:
refs/tags/0.6.0rc2 - Owner: https://github.com/nasa
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@1c4a921c7d307ac160ceaf3c70517b1c19f4acbf -
Trigger Event:
push
-
Statement type:
File details
Details for the file bingo_nasa-0.6.0rc2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: bingo_nasa-0.6.0rc2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 613.8 kB
- Tags: CPython 3.11, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d7a874958b1b85408f19ebd0212baa096739c0ef00af11f8dfa8853a4d1d2a12
|
|
| MD5 |
6673423b66303e4b38a5e84bbfb93c54
|
|
| BLAKE2b-256 |
2f3c39947fe12a5ca17248748e84a20e3d1597ef83b1db1b252e4f30674e9832
|
Provenance
The following attestation bundles were made for bingo_nasa-0.6.0rc2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
pypi.yml on nasa/bingo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bingo_nasa-0.6.0rc2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
d7a874958b1b85408f19ebd0212baa096739c0ef00af11f8dfa8853a4d1d2a12 - Sigstore transparency entry: 2467568737
- Sigstore integration time:
-
Permalink:
nasa/bingo@1c4a921c7d307ac160ceaf3c70517b1c19f4acbf -
Branch / Tag:
refs/tags/0.6.0rc2 - Owner: https://github.com/nasa
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@1c4a921c7d307ac160ceaf3c70517b1c19f4acbf -
Trigger Event:
push
-
Statement type: