Search for a command to run...
Background The burden of maternal postpartum depression and anxiety is disproportionately high in sub-Saharan Africa (SSA), yet the use of advanced analytical methods to capture the complex interplay of variables influencing these conditions remains underexplored. Objective To apply machine learning (ML) methods to predict depressive and anxiety symptoms in postpartum mothers and to identify key and actionable predictors. Methods This cross-sectional study included 1,995 biological mothers of singleton infants aged 0–6 months, using survey data collected between March 2023 and March 2024 in Kaloleni and Rabai sub-counties, Kilifi County, Kenya, within the Kaloleni–Rabai Health and Demographic Surveillance System. Depressive and anxiety symptoms were assessed using the Patient Health Questionnaire-9 and Generalized Anxiety Disorder-7, with scores ≥5 indicating symptoms. Potential features included sociodemographic, economic, nutritional, food insecurity, and health-related factors. Ridge Logistic Regression (LR), Random Forest (RF), and Extreme Gradient Boosting (XGBoost) models were applied to predict depressive and anxiety symptoms. Model performance was evaluated using area under the receiver operating characteristic curve (AUC), accuracy, sensitivity, and specificity. Shapley additive explanations values were used for feature selection and interpretation. Results Among the 1,995 mothers, 15.1% had depressive symptoms, and 8.7% had anxiety symptoms. Model performance was acceptable and comparable across all models. For depression, AUC values for Ridge LR, RF and XGBoost were 0.724 (95% CI: 0.656–0.785), 0.711 (95% CI: 0.642–0.774), and 0.705 (95% CI: 0.628–0.772) respectively. For anxiety, AUCs were 0.788 (95% CI: 0.712–0.857), 0.789 (95% CI: 0.709–0.861), and 0.785 (95% CI: 0.708–0.854), respectively. Increased household food insecurity was the strongest predictor of both conditions. Additional key predictors included low wealth index, lower body mass index, higher number of children, pregnancy complications and advanced maternal age. Conclusions Postpartum mental health disorders remain a substantial burden in SSA. This study demonstrates the feasibility of using ML to predict depressive and anxiety symptoms in postpartum mothers. The findings identify key predictors, notably increased household food insecurity, alongside socioeconomic status and maternal health characteristics, that could inform the design and testing of targeted interventions. Future studies should include external validation and examine causal links between these predictors and postpartum mental health outcomes.