Abstract
Biologic disease-modifying antirheumatic drugs (bDMARDs) have transformed the clinical management of rheumatoid arthritis (RA), yet their therapeutic benefits are frequently compromised by severe adverse drug reactions (ADRs), including opportunistic infections, hepatotoxicity, and hematologic cytopenias. This study evaluated an automated machine learning framework designed to predict the individual risk of serious ADRs within six months of initiating biologic therapy using real-world electronic health record (EHR) data. We extracted longitudinal clinical, demographic, laboratory, and pharmacological features from a multicenter cohort of 4,820 adult RA patients initiating bDMARD regimens between 2014 and 2023. Multiple supervised learning algorithms, including Extreme Gradient Boosting (XGBoost), Random Forest, LightGBM, and regularized logistic regression, were trained and validated using stratified five-fold cross-validation. The XGBoost model demonstrated superior predictive performance, achieving an area under the receiver operating characteristic curve (AUC-ROC) of 0.842 (95% CI: 0.821–0.863) and a precision-recall AUC of 0.615, markedly outperforming conventional clinical risk indices. Key predictive features identified via SHapley Additive exPlanations (SHAP) included baseline serum albumin, concomitant oral corticosteroid dosage, baseline estimated glomerular filtration rate, and historical infection burden. These results substantiate the potential of EHR-driven machine learning algorithms as robust, point-of-care clinical decision-support tools for individualized pharmacovigilance and proactive risk mitigation in rheumatology.