Open Access
CC BY 4.0 · Pharmacopsychiatry
DOI: 10.1055/a-2593-3125
Original Paper

Ensemble Machine Learning Model for Real-Time Valproic Acid Prediction in Epilepsy Treatment

Jiangchuan Xie
1   Department of pharmacy, The First Affiliated Hospital of Army Medical University, Chongqing, China
,
Pan Ma
1   Department of pharmacy, The First Affiliated Hospital of Army Medical University, Chongqing, China
,
Xinmei Pan
1   Department of pharmacy, The First Affiliated Hospital of Army Medical University, Chongqing, China
,
Liya Cao
1   Department of pharmacy, The First Affiliated Hospital of Army Medical University, Chongqing, China
,
Ruixiang Liu
1   Department of pharmacy, The First Affiliated Hospital of Army Medical University, Chongqing, China
,
Lirong Xiong
1   Department of pharmacy, The First Affiliated Hospital of Army Medical University, Chongqing, China
,
Hongqian Wang
2   Medical Big Data and Artificial Intelligence Center, the First Affiliated Hospital of Army Medical University, Chongqing, China
,
Xin Zhang
1   Department of pharmacy, The First Affiliated Hospital of Army Medical University, Chongqing, China
,
Linli Xie#
1   Department of pharmacy, The First Affiliated Hospital of Army Medical University, Chongqing, China
2   Medical Big Data and Artificial Intelligence Center, the First Affiliated Hospital of Army Medical University, Chongqing, China
,
Yongchuan Chen#
1   Department of pharmacy, The First Affiliated Hospital of Army Medical University, Chongqing, China
› Institutsangaben
Preview

Abstract

Aims

To develop an optimal model to predict valproic acid (VPA) concentrations by machine learning, ensuring that the VPA plasma concentration is in the effective treatment range, and thus effectively control the patient’s epilepsy.

Methods

This single-center, retrospective study included patients diagnosed with epilepsy from January 2014 to January 2022. Patients receiving VPA and having undergone therapeutic drug monitoring were enrolled. Top three algorithms exhibiting superior model performance were selected to establish the ensemble prediction model, with Shapley Additive exPlanations (SHAP) employed for model interpretation. An independent dataset was collected as a clinical validation group to verify the prediction model performance.

Results

The algorithms chosen for the ensemble model—Light Gradient Boosting, Categorical Boosting, and Gradient Boosted Regression Trees—demonstrated high R 2 (0.549, 0.515, and 0.503, respectively). Post-feature selection, the final model incorporated 20 variables, proving superior in predictive performance compared to models considering all 24 variables. The R 2 , mean absolute error, mean square error, absolute accuracy (±20 mg/L), and relative accuracy (±20%) of external validation were 0.621, 10.67, 221.50, 78.98%, and 66.48%, respectively. The importance and direction of each variable were visually represented using SHAP values, with VPA administration and liver function emerging as the most significant factors.

Conclusion

The innovative application harnesses advanced multi-algorithm mining methodologies to forecast VPA concentrations in adult epileptic patients. Furthermore, it employs SHAP to elucidate the nuanced influence of each feature within the integrated prediction model, thereby providing a robust and plausible explanation for the determinants affecting VPA concentration predictions.

These authors contributed equally to this work: Jiangchuan Xie, Pan Ma


# These authors are equal corresponding authors: Linli Xie, Yongchuan Chen


Supplementary Material



Publikationsverlauf

Eingereicht: 11. Juli 2024

Angenommen: 08. April 2025

Artikel online veröffentlicht:
02. Juni 2025

© 2025. The Author(s). This is an open access article published by Thieme under the terms of the Creative Commons Attribution License, permitting unrestricted use, distribution, and reproduction so long as the original work is properly cited. (https://creativecommons.org/licenses/by/4.0/).

Georg Thieme Verlag KG
Oswald-Hesse-Straße 50, 70469 Stuttgart, Germany