Research on the timely medication retrieval prediction model for outpatients based on a two-stage adaptive threshold ensemble learning algorithm
- VernacularTitle:基于两阶段自适应阈值集成学习算法的门诊患者及时取药预测模型研究
- Author:
Yuanyuan FAN
1
;
Feng WANG
2
;
Panke ZENG
2
;
Weiyi FENG
2
Author Information
1. Dept. of Pharmacy,the First Affiliated Hospital of Xi’an Jiaotong University,Xi’an 710061,China;Dept. of Pharmacy,Northwest Women’s and Children’s Hospital,Xi’an 710061,China
2. Dept. of Pharmacy,the First Affiliated Hospital of Xi’an Jiaotong University,Xi’an 710061,China
- Publication Type:Journal Article
- Keywords:
outpatient prescription;
timely medication retrieval prediction;
cluster analysis;
machine learning;
ensemble
- From:
China Pharmacy
2025;36(24):3118-3124
- CountryChina
- Language:Chinese
-
Abstract:
OBJECTIVE To construct a predictive model for timely medication retrieval of outpatients, accurately identify high-risk patients with delayed medication retrieval, and provide data support for the development of differentiated registration strategies and resource optimization allocation in smart pharmacies. METHODS Based on 680 568 valid outpatient prescription records from January to March 2025 at the First Affiliated Hospital of Xi’an Jiaotong University, a dual-clustering analysis was conducted using K-means algorithm and Gaussian mixture model (GMM). An adaptive threshold for medication retrieval time difference was determined by combining contour coefficients, and “timely medication retrieval” and “delayed medication retrieval” were divided to construct binary objective variables; six types of features were screened through a multi-method fusion strategy; the performance of 6 kinds of base learners and 4 kinds of ensemble learning models were evaluated from three dimensions: discrimination, overall performance, and calibration, and explanatory analysis of the models were conducted. RESULTS The results of the dual-clustering analysis showed that the silhouette coefficient of GMM was better than K-means (0.702 4 vs. 0.698 8), and the final adaptive threshold was determined to be 49.82 min. Among the prescriptions included, 74.99% were for timely medication retrieval and 25.01% were for delayed medication retrieval. Among the 10 candidate models, the Stacking model performed the best, with an area under the test set curve of 0.954 4, F1 score of 0.942 4, accuracy of 0.911 5, Brier score of 0.066, and good discrimination and calibration. The explanatory analysis results of the model showed that its predictions were driven by multiple factors such as patient historical behavior, and diagnostic related characteristics. CONCLUSION This study constructed a timely medication retrieval prediction model for outpatients based on a two-stage adaptive threshold ensemble learning algorithm, which has high accuracy and stability, and can achieve dynamic judgment of patient medication retrieval behavior.