"Nonlinearity of the post-spinel transition and its expression in slabs and plumes worldwide"
If you use the code and/or database here, please cite this article: Dong, J. et al. Nonlinearity of the post-spinel transition and its expression in slabs and plumes worldwide. Nat Commun 16, 1039 (2025). https://doi.org/10.1038/s41467-025-56231-z
- Junjie Dong
- Rebecca A. Fischer
- Lars P. Stixrude
- Matthew C. Brennan
- Kierstin Daviau
- Terry-Ann Suer
- Katlyn M. Turner
- Yue Meng
- Vitali B. Prakapenka
- Junjie Dong
This repository consists of two main parts:
- Model Selection with Supervised Learning
- Phase Diagram Construction
The code analyzes phase equilibria observations and computes a globally optimized phase diagram through multi-class logit regression and supervised learning. The code can be used generally, but the construction of phase relations in Mg2SiO4 at mantle transition zone conditions is used as a benchmark case to ensure reproducibility and ease of use, and the data on phase equilibria observations of Mg2SiO4 are provided.
Follow the instructions below or in the Python scripts to reproduce the analyses discussed in the manuscript.
The primary packages used in this code are:
matplotlib=3.5.0numpy=1.19.5pandas=1.3.5python=3.9.20scikit-learn=0.23.2scipy=1.10.0
For full package compatibility, you can use the provided conda environment file or requirements file.
-
Set up the conda environment:
conda env create -f environment.yml conda activate mlpd
-
Alternatively, you can install dependencies using pip:
pip install -r requirements.txt
-
To tune the hyperparameters for the model, run 'logit-reg-model-selection.py':
python logit-reg-model-selection.py
-
You can find the optimized degree and other hyperparameters in the 'log.txt' file. After updating the optimized degree and other hyperparameters, run 'logit-reg-fit.py':
python logit-reg-fit.py