Interpretable prediction of anxiety symptoms during pregnancy via machine learning and SHAP
摘要
Perinatal anxiety severely impacts maternal and infant health, yet efficient screening remains a challenge. This study aims to create a clinically interpretable screening framework by employing a machine learning (ML) model explained via Shapley additive explanations (SHAP).
MethodsThis cross-sectional study was conducted between November 2022 and August 2023 at a tertiary teaching hospital in Guangzhou, China. We assessed pregnant women for prenatal anxiety symptoms via the Generalized Anxiety Disorder Scale (GAD-7). Four ML models—random forest (RF), support vector machine (SVM), extreme gradient boosting (XGBoost), and k-nearest neighbor (KNN)—were trained and evaluated via 10-fold cross-validation with a 7:3 train‒test split. Model performance was assessed by the area under the receiver operating characteristic curve (AUC), and SHAP values were used to interpret feature contributions.
ResultsWe screened 3141 participants via the GAD-7 and identified 318 with prenatal anxiety symptoms, yielding an incidence of 10.1%. The variables most strongly associated with anxiety were selected from 30 candidate variables by using the Boruta algorithm. XGBoost achieved the highest discriminative performance (AUC = 0.712), slightly outperforming RF (AUC = 0.711) and SVM (AUC = 0.633). The KNN model showed near-random performance (AUC = 0.509). SHAP analysis identified sleep quality, premenstrual tension, age, personality, spousal and mother‑daughter‑in‑law relationship quality, occupation, education, dietary habits, and stressful life events as key factors associated with antenatal anxiety symptoms.
ConclusionsThe XGBoost model demonstrated acceptable accuracy for identifying antenatal anxiety symptoms. SHAP-based interpretability helps highlight high-impact psychosocial and lifestyle factors, offering a potential tool for early identification and prevention strategies in obstetric care.