AUTHOR=Lin Shusen , Wang Peng , Yue Chongyu , Kuang Guofang , Han Xuefei , Zhang Yanxia , Wang Xiaojing , Wang Min , Huan Shanshan , Zhang Xinwei , Tan Ping , Li Huawei TITLE=Development and validation of an interpretable machine learning model and online web-based calculator based on social-ecosystem theory for early prediction of postpartum depression: a longitudinal study JOURNAL=Frontiers in Public Health VOLUME=Volume 13 - 2025 YEAR=2025 URL=https://www.frontiersin.org/journals/public-health/articles/10.3389/fpubh.2025.1685305 DOI=10.3389/fpubh.2025.1685305 ISSN=2296-2565 ABSTRACT=BackgroundPostpartum depression (PPD) has emerged as a global public health issue that can cause significant harm to mothers and their families. Currently, there is an urgent need for a robust early risk prediction model to enable accurate predictions of postpartum depression in hospitals.MethodsThis was a longitudinal study. Using social ecosystem theory, we collected multi-dimensional and multi-angle risk factors for early postpartum depression from delivery to discharge, and conducted 42-day postpartum follow-ups using the Edinburgh Postnatal Depression Scale (EPDS). We strictly adhered to the Transparent Reporting of a Multivariable Prediction Model for Individual Prognosis or Diagnosis (TRIPOD) checklist, used 10 machine learning (ML) algorithms to construct and validate the prediction model, and employed the Shapley additive explanation (SHAP) algorithm to explain the model. Risk stratification was performed through K-Means clustering analysis, ultimately resulting in an clinical screening tool for early PPD risk prediction.ResultsThe results showed that by comparing the performance of prediction models constructed by the 10 ML algorithms, the model constructed using the random forest algorithm was selected as the best, with an area under the receiver operating characteristic curve (AUC) of 0.91 (95% CI: 0.85–0.96) and 0.77 (95% CI: 0.70–0.85) in internal and external validation. Low risk probability (0, 0.26], medium risk probability (0.26, 0.63), and high risk probability (0.63, 1) were obtained through K-Means clustering analysis, and the SHAP value of the model was interpreted. Finally, we developed an online risk prediction calculator.ConclusionThis study developed an interpretable risk prediction model for early PPD, which may help healthcare providers to identify and implement intervention measures early, preventing the occurrence of PPD.