Bgolearn#
Note
Welcome to the documentation of Bgolearn : a powerful Bayesian Global Optimization package specifically designed for materials discovery. This document is written and produced by Bin Cao to help new learners master the basics of Bayesian Optimization and use Bgolearn to solve real-world optimization problems.
What is Bgolearn?
Bgolearn is a Python package developed by Bin Cao at Hong Kong University of Science and Technology (Guangzhou) that implements state-of-the-art Bayesian optimization algorithms for both single-objective and multi-objective optimization. It’s particularly powerful for materials discovery, where experiments are costly and time-consuming.
Key Features:
Single-objective optimization with multiple acquisition functions
Multi-objective optimization via MultiBgolearn
Materials-focused design and applications
Flexible surrogate model selection
Bootstrap uncertainty quantification
What makes Bgolearn special?
Materials-focused: Built specifically for materials science workflows
Parallel experiments: Batch optimization for efficient resource utilization
Rich visualizations: Interactive plots and optimization dashboards
Robust & reliable: Comprehensive error handling and data validation
Easy to use: Simple API with sensible defaults
About
The Bgolearn project is supported by the Shanghai Artificial Intelligence Open Source Award Project Support Plan (上海市人工智能开源奖励项目支持计划, 2025), with a funding of 500,000 RMB. Special thanks to Prof. Jie Xiong and Prof. Tong-Yi Zhang from Shanghai University for their support in this project.
An updated survey of Bgolearn has been published on arXiv, 2026. We express our deep gratitude for the guidance and contributions of Prof. Tong-Yi Zhang (Shanghai University, HKUST(GZ)), Prof. Turab Lookman (Xi’an Jiaotong University), Prof. Dezhen Xue (Xi’an Jiaotong University), Prof. Jie Xiong (Shanghai University), and Prof. Jian Hui (Suzhou Laboratory).
Key Features
Specialized workflows for composition optimization, processing parameter tuning, and multi-objective materials design.
EI, UCB, PI, PES, KG, etc. for different optimization strategies and experimental constraints.
Select multiple experiments for parallel execution, dramatically reducing optimization time and cost.
Interactive plots, optimization dashboards, and materials-specific visualizations for better insights.
Quick Start Example
1from Bgolearn import BGOsampling
2import pandas as pd
3import numpy as np
4
5# Load your materials data
6X_train = pd.DataFrame(np.random.randn(20, 3), columns=['Temperature', 'Pressure', 'Composition'])
7y_train = pd.Series(np.random.randn(20)) # Target property (e.g., strength)
8X_candidates = pd.DataFrame(np.random.randn(100, 3), columns=['Temperature', 'Pressure', 'Composition'])
9
10# Initialize and fit Bgolearn
11optimizer = BGOsampling.Bgolearn()
12model = optimizer.fit(
13 data_matrix=X_train, # Pass DataFrame directly
14 Measured_response=y_train, # Pass Series directly
15 virtual_samples=X_candidates, # Pass DataFrame directly
16 opt_num=1
17)
18
19# Get recommendation using Expected Improvement
20ei_values, recommended_points = model.EI()
21
22# The recommended point(s)
23next_experiment = recommended_points[0] # First (best) recommendation
24print(f"Next recommended experiment: {next_experiment}")
25
26# Get prediction for all virtual samples
27predicted_values = model.virtual_samples_mean
28print(f"Number of predictions: {len(predicted_values)}")
29
30# Basic visualization using matplotlib
31import matplotlib.pyplot as plt
32
33# Plot EI values
34plt.figure(figsize=(10, 6))
35plt.plot(ei_values)
36plt.title('Expected Improvement Values')
37plt.xlabel('Candidate Index')
38plt.ylabel('EI Value')
39plt.show()
Installation#
pip install bgolearn
git clone https://github.com/Bin-Cao/Bgolearn.git
cd Bgolearn
pip install -e .
# Complete installation with all features
pip install bgolearn[all]
# Or install specific components
pip install bgolearn plotly seaborn # For advanced visualization
pip install bgolearn pymatgen matminer # For materials science
Verify Installation
from Bgolearn import BGOsampling
print("Bgolearn imported successfully!")
# Test basic functionality
opt = BGOsampling.Bgolearn()
print("Bgolearn optimizer initialized successfully!")
Documentation Structure#
This documentation is organized into several main sections:
Installation, basic concepts, and your first optimization
Graphical user interface for visual optimization workflows
API reference, acquisition functions, and optimization strategies
Materials discovery workflows and specialized applications
Learning Paths#
Choose your learning path based on your background and goals:
New to Bayesian Optimization?
Getting Started with Bgolearn - Installation and basic concepts
Your First Optimization - Your first optimization tutorial
Acquisition Functions Guide - Understanding acquisition functions
Single-Objective Optimization Examples - Single-objective examples
Focused on materials discovery?
Materials Discovery with Bgolearn - Materials discovery overview
Single-Objective Optimization Examples - Alloy composition optimization
MultiBgolearn: Multi-Objective Bayesian Global Optimization - Multi-objective optimization
Multi-Objective Optimization Examples - Multi-property design examples
Ready for advanced features?
Optimization Strategies - Advanced optimization strategies
Surrogate Models in Bgolearn - Different surrogate models
BgoFace: Graphical User Interface for Bgolearn - GUI interface for visual workflows
MultiBgolearn: Multi-Objective Bayesian Global Optimization - Multi-objective optimization
Community & Support#
Get Help & Connect
GitHub Discussions: Ask questions and share experiences
Issues: Report bugs and request features
Email: binjacobcao@gmail.com
Documentation: You’re reading it!
Citation#
If you use Bgolearn in your research, please cite our work:
@article{cao2026bgolearn,
title = {Bgolearn: a Unified Bayesian Optimization Framework for Accelerating Materials Discovery},
author = {Cao, Bin and Xiong, Jie and Ma, Jiaxuan and Tian, Yuan and Hu, Yirui and He, Mengwei and Zhang, Longhan and Wang, Jiayu and Hui, Jian and Liu, Li and Xue, Dezhen and Lookman, Turab and Zhang, Tong-Yi},
journal = {arXiv preprint arXiv:2601.06820},
year = {2026},
eprint = {2601.06820},
archivePrefix= {arXiv},
primaryClass = {cond-mat.mtrl-sci},
doi = {https://doi.org/10.48550/arXiv.2601.06820},
note = {38 pages, 5 figures}
}
License#
MIT License
Bgolearn is released under the MIT License, making it free for both academic and commercial use. See the full license for details.
Ready to accelerate your research? Start here or explore our examples to see Bgolearn in action!