A lightweight multi-objective tool package for Bgolearn
Project description
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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
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 bgokit-0.1.1.tar.gz.
File metadata
- Download URL: bgokit-0.1.1.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a03ae5a93cb674e2bf9640812302bb41fd50a0c95c090788957370933f9d7a5b
|
|
| MD5 |
decc442ee1fa745ca928633e297821db
|
|
| BLAKE2b-256 |
6cccb59e258278a0c88aae624d0503f39e1e8516e333e2457586e1ab87b74d33
|
File details
Details for the file bgokit-0.1.1-py3-none-any.whl.
File metadata
- Download URL: bgokit-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a919f9931270ed884d0c9d174bad065f8a6e5ff913a894b9065f8f1920f0dbe8
|
|
| MD5 |
5f59783add003cc517ca5bd99bb90cfa
|
|
| BLAKE2b-256 |
9b1acc63280bff779166ab8cb99b0a7d436adf2d71eccb9bb7e297ac4f10fd3c
|