Skip to main content

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:

  • numpy
  • matplotlib
  • MultiBgolearn

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.txt
  • ParetoF.png and ParetoF.svg
  • HV_UCB.png and HV_UCB.svg
  • HV_UCB_NOcandidates.png and HV_UCB_NOcandidates.svg
  • HV_EIorPi.png and HV_EIorPi.svg
  • HV_EIorPi_NOcandidates.png and HV_EIorPi_NOcandidates.svg
  • distribution.png and distribution.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)

Source distribution for BgoKit 0.1.1
File Size Uploaded
bgokit-0.1.1.tar.gz 7.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for BgoKit 0.1.1
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

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