Background: Levetiracetam is an antiepileptic drug widely used to treat partial and generalized seizures in clinicians. The effectiveness and safety of levetiracetam in individuals with epilepsy are affected by various complex factors, including physiological condition and genetic variations. Therapeutic drug monitoring (TDM) serves as a valuable tool to optimize levetiracetam treatment and enable individualized treatment for patients with epilepsy. Machine learning is now a powerful tool for data processing and analysis. However, there is a lack of studies on the application of machine learning methods for the prediction of levetiracetam blood concentration in epilepsy patients. Objective: The aim of this study is to develop machine learning models to predict levetiracetam concentration in epilepsy patients, utilizing a web application for clinical dosage adjustment. Design: This is a retrospective study enrolling patients diagnosed with seizures and given levetiracetam therapy at Beijing Hospital from January 1, 2024, to May 22, 2025. Method: This study included 153 cases of levetiracetam TDM data in patients with epilepsy. A total of 47 variables from five dimensions of enrolled patients were collected, and sequential forward selection was implemented to screen the optimum variable subsets related to levetiracetam TDM. The prediction abilities of multiple machine learning models were compared based on subset variables. The optimal prediction model was subsequently chosen to calculate and rank the importance scores of each variable, and SHapley Additive exPlanations (SHAP) was adopted to visually interpret the impact of variables on levetiracetam concentration. Results: The median value of levetiracetam TDM was 10.95 μg/mL, and the levetiracetam TDM of 72 cases (47.1%) was found to be lower than the recommended range. Eleven variables were finally identified as the optimal subset variables. Using the eleven variables as the covariates, the eXtreme Gradient Boosting (XGBoost) algorithm performed best ( R 2 = 0.50, mean absolute error = 0.43, and root mean square error = 0.58). In comparison, five variables, including age, daily dose, UREA, URIC, and hemoglobin, showed higher importance scores than other variables. SHAP values indicated that the daily dose made the greatest contribution to prediction performance, and a positive impact on levetiracetam concentration was found. Conclusion: Our study found that XGBoost is a valuable artificial intelligence instrument for predicting levetiracetam concentration. Daily dose and age were two significant covariates influencing serum concentration. This work is the first study to analyze the levetiracetam concentration data from the real world and predict the blood concentration using machine learning techniques, which provides guidance for the drug adjustment in clinical practice.
Zhu et al. (2026) studied this question.