This repository contains the reproducible experiment for the course paper "基于组成描述符与集成学习的无机材料实验带隙预测研究".
The experiment predicts experimental band gaps from chemical composition alone.
It uses the public matbench_expt_gap dataset, 132 Magpie elemental-property
descriptors, and four regression methods: a mean-value baseline, Random Forest,
Extra Trees, and Histogram Gradient Boosting.
The dataset contains 4,604 inorganic compositions. With an 80/20 train-test
split (random_state=42) and 5-fold cross-validation on the training set, the
best test MAE was obtained by Extra Trees:
| Model | Test MAE (eV) | Test RMSE (eV) | Test R2 |
|---|---|---|---|
| Extra Trees | 0.414 | 0.807 | 0.697 |
| Histogram Gradient Boosting | 0.435 | 0.802 | 0.701 |
| Random Forest | 0.448 | 0.835 | 0.676 |
| Mean baseline | 1.173 | 1.467 | ~0.000 |
src/bandgap_experiment.py Reproducible experiment
results/ Metrics, predictions and error analysis
figures/ Figures used in the paper
requirements.txt Python dependencies
Python 3.12 is recommended.
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
python src/bandgap_experiment.pyThe Matbench dataset is downloaded automatically by Matminer. The first run also caches the 132 composition descriptors so later reruns are faster.
- Matbench dataset and benchmark code: https://github.com/materialsproject/matbench
- Matminer feature engineering: https://github.com/hackingmaterials/matminer
- Extra Trees model documentation: https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.ExtraTreesRegressor.html
- Random Forest model documentation: https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.RandomForestRegressor.html
- Histogram Gradient Boosting documentation: https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.HistGradientBoostingRegressor.html
- Dataset DOI: https://doi.org/10.6084/m9.figshare.9765779.v1
The model uses chemical composition only. It does not include crystal structure, defects, synthesis conditions, temperature, or measurement method. Random train-test splitting can also place chemically related compounds in both sets. Therefore, the reported metrics demonstrate a reproducible course experiment rather than a claim that the model can replace electronic-structure calculations or laboratory tests.
The experiment code is released under the MIT License. Dataset use follows the license and citation requirements of Matbench/Matminer and the original dataset.