BgoKit
BgoKit is a lightweight utility package for multi-objective candidate selection with Bgolearn. It provides tools for two-objective Pareto-front search, hypervolume-based selection, and score-distribution visualization.
Author: Dr.Bin Cao
Website: https://bin-cao.github.io/
Documentation: https://bgolearn.netlify.app/
Repository: https://github.com/Bin-Cao/Bgolearn
Installation
Install the package from PyPI:
pip install BgoKit
Install or upgrade from a local source tree:
pip install -U .
Requirements
BgoKit requires Python 3.7 or later and depends on:
numpymatplotlibMultiBgolearn
Quick Start
The following example shows how to combine two Bgolearn score arrays and recommend a candidate from the Pareto front.
import pandas as pd
import Bgolearn.BGOsampling as BGOS
from BgoKit import ToolKit
# Load measured data and virtual samples.
data = pd.read_csv("./data/data.csv")
vs = pd.read_csv("./data/Visual_samples.csv")
# Use the first columns as input features and the final two columns as targets.
x = data.iloc[:, :-2]
y_t = data.iloc[:, -2]
y_e = data.iloc[:, -1]
# Run Bgolearn for two target properties.
bgolearn = BGOS.Bgolearn()
model_t = bgolearn.fit(
data_matrix=x,
Measured_response=y_t,
virtual_samples=vs,
min_search=False,
)
score_t, rec_t = model_t.UCB()
model_e = bgolearn.fit(
data_matrix=x,
Measured_response=y_e,
virtual_samples=vs,
min_search=False,
)
score_e, rec_e = model_e.UCB()
# Run BgoKit for multi-objective candidate selection.
model = ToolKit.MultiOpt(vs, [score_t, score_e], names=["Strength", "Elongation"])
candidate = model.BiSearch()
model.plot_distribution()
Main API
ToolKit.MultiOpt(vs, scores, names=None)
Create a multi-objective optimization helper.
vs: virtual samples or candidate feature matrix.scores: list of score arrays, typically[score_1, score_2].names: optional objective names used in plot labels.
MultiOpt.BiSearch()
Normalize two score arrays, identify the Pareto front, save Pareto data to
./Bgolearn/Paretodata.txt, generate Pareto-front figures, and return the selected
candidate.
MultiOpt.HVSearch(y)
Perform hypervolume-improvement candidate selection for the UCB workflow.
MultiOpt.HVSearch_user(y)
Perform the educational hypervolume-improvement workflow designed for expected improvement and probability improvement examples.
MultiOpt.plot_distribution()
Plot normalized score distributions for each objective.
Generated Files
Depending on the selected workflow, BgoKit may create:
./Bgolearn/Paretodata.txtParetoF.pngandParetoF.svgHV_UCB.pngandHV_UCB.svgHV_UCB_NOcandidates.pngandHV_UCB_NOcandidates.svgHV_EIorPi.pngandHV_EIorPi.svgHV_EIorPi_NOcandidates.pngandHV_EIorPi_NOcandidates.svgdistribution.pnganddistribution.svg
Citation
If BgoKit or Bgolearn supports your research, please cite the related publication:
npj Computational Materials: https://doi.org/10.1038/s41524-026-02226-3
License
This project is released under the MIT License.
Metadata
Release files for BgoKit 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| bgokit-0.1.1.tar.gz | 7.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bgokit-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.2 kB
Release files / bgokit-0.1.1.tar.gz
| Download URL | bgokit-0.1.1.tar.gz |
|---|---|
| Size | 7.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a03ae5a93cb674e2bf9640812302bb41fd50a0c95c090788957370933f9d7a5b
|
|
BLAKE2b-256 checksum How to use checksums |
6cccb59e258278a0c88aae624d0503f39e1e8516e333e2457586e1ab87b74d33
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.19
|
Release files / bgokit-0.1.1-py3-none-any.whl
| Download URL | bgokit-0.1.1-py3-none-any.whl |
|---|---|
| Size | 7.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a919f9931270ed884d0c9d174bad065f8a6e5ff913a894b9065f8f1920f0dbe8
|
|
BLAKE2b-256 checksum How to use checksums |
9b1acc63280bff779166ab8cb99b0a7d436adf2d71eccb9bb7e297ac4f10fd3c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.19
|