The aim of this study was: (1) to determine how early during pregnancy postpartum depression (PPD) can be predicted and (2) to identify the most predictive prenatal risk factors for developing PPD (measured at 8–10 weeks after delivery). To achieve this, we evaluated the performance of nine machine learning models. These models were progressively trained with increasing amounts of data: the first model included only first-trimester data, and the final model used variables collected throughout the entire pregnancy (i.e., data collected at all three trimesters). This process mimics clinical practice, where health professionals accumulate data from pregnant women over the course of pregnancy. Firstly, our results suggested that women at low risk for PPD can already be identified based on variables collected during the first trimester. Secondly, we identified the following variables as the most important prenatal predictors of PPD: depression during pregnancy, negative affectivity, pregnancy distress and history of mental disorder treatment.

Our findings indicate that PPD can be predicted as early in pregnancy as 12 weeks, using variables collected during the first trimester. Although model performance improved slightly with the addition of data from the second and third trimesters, the mean MSE remained relatively stable. This suggests that additional information from later trimesters does not drastically improve the prediction models, and first-trimester variables are sufficient for early prediction of PPD. Importantly, the high specificity of our models demonstrates that we can accurately identify women who are unlikely to develop PPD, allowing healthcare providers to withhold intensive interventions from this low-risk group and focus resources on those who need them most. However, comparing our MSE values to those from other studies is difficult because most researchers treat PPD prediction as a classification task, dichotomizing the EDS score at a clinical cutoff, rather than as a regression problem18. Nevertheless, most classification performance metrics found in this study are comparable to those reported in similar studies.

We must however note that the sensitivity (i.e., 0.19) found in this study was lower than found in previous similar work. For example, Andersson et al.16, predicted PPD at six weeks postpartum and reported a sensitivity of 0.71. Although predictive performance cannot be directly compared across studies due to differences in sample size, variables, and ML algorithms, we still consider different possible explanations for the observed differences. First, many existing studies focus on “nowcasting” rather than actual forecasting, using postpartum data collected at the same time as the to be predicted depressive symptoms. This essentially describes how PPD presents itself (i.e., its indicators and manifestation) rather than predicting it. In contrast, our study aimed to predict PPD with data gathered during pregnancy alone. This strategy is clinically preferable, as it enables early intervention during pregnancy to prevent PPD before its onset. Second, our models were optimized to minimize MSE rather than classification-specific metrics such as sensitivity, which might partially account for the lower sensitivity. Furthermore, the EDS distribution was heavily right-skewed (i.e., a floor effect), with the majority of mothers with a total score below 10. This skewness limits the model’s ability to learn patterns from the data of mothers at higher risk of developing PPD, as there is relatively less information available for this group of mothers. Finally, predicting PPD may be challenging because research indicates that it is not a single, homogeneous disorder27. Many studies, including Osborne et al.28, suggest that PPD consists of multiple subtypes, each associated with different risk factors. Specifically Osborne et al.28, propose that women who have no prenatal depressive symptoms yet develop PPD differ hormonally from those who experience depression during pregnancy and then develop PPD, highlighting the disorder’s heterogeneity.

Our findings further indicate that self-reported depressive symptoms during pregnancy are the most predictive risk factor across all trimesters. This finding, consistent with other recent research, is encouraging because the EDS is a simple, 10-item questionnaire that is easy to administer and score, making it feasible for routine screening during pregnancy29. This closely aligns with the priorities of healthcare providers, who have indicated the need for quick and easy to administer screening tools30.

In addition to self-reported depressive symptoms, several other psychological risk factors were identified as important. These included self-reported measures of pregnancy distress (TPDS)25, neuroticism (BFI-2-S)26, negative affectivity (DS14)24, and a history of treatment for mental disorders. Personality traits such as neuroticism and negative affectivity (the latter being a dimension of Type D personality) have both been linked to PPD in previous research31,32. Individuals with high levels of neuroticism tend to experience more negative emotions due to heightened stress reactivity33. The postpartum period, being particularly stressful, has the potential to magnify these negative emotions, increasing the risk of PPD. Similarly, individuals with high negative affectivity have a general predisposition toward negative emotions, which has been associated with an increased risk of PPD34.

In addition to the psychological variables, biological risk factors such as low BMI and rheumatism were also predictive of PPD. Previous research has shown that low BMI is a risk factor for PPD independent of prior depression history, possibly because mood regulation is closely linked to nutritional status35. Note that elevated BMI has also been linked to increased PPD risk, likely via pro‑inflammatory pathways36. However, the underrepresentation of women with high BMI in our cohort reduced the statistical power to replicate this finding. Various types of rheumatic diseases have previously been linked to PPD37. Rheumatoid arthritis, specifically, was found to be associated with an increased risk of PPD among women without a history of psychiatric disorders38. Although our study did not distinguish between different types of rheumatic conditions, it is plausible that similar physiological and psychological mechanisms, such as chronic inflammation, hormonal fluctuations, and immune system dysregulation, underlie the association between rheumatism and PPD.

Our study has several strengths and limitations. One strength is that our research closely aligns with clinical practice, as risk factors were measured in parallel with routine check-ups by midwives and/or gynecologists in the Netherlands. This means that the identified risk factors can be more easily implemented into routine screening protocols. Another strength is the inclusion of a wide range of potential risk factors, which allowed us to evaluate the relative predictive performance of these variables within a single model. Furthermore, the large sample size enhances the robustness and generalizability of our machine learning models.

However, a limitation of this study is the non-representative sample, as it primarily includes highly educated white mothers who are married or cohabiting with their partners. This may limit the generalizability of our findings to more diverse populations. In addition, the right-skewed distribution of EDS scores and our choice to optimize for mean squared error rather than sensitivity potentially constrained the model’s ability to detect true positives among women at highest risk. To address these limitations, future studies should recruit more varied demographic and clinical subgroups (including different socioeconomic and ethnic groups) and incorporate additional predictive data such as perinatal biomarkers (e.g. DNA methylation biomarkers, inflammatory markers) and longitudinal data collected at more frequent intervals to improve sensitivity and ensure that models can accurately identify women who will develop PPD.

Nevertheless, our findings are highly relevant for clinical practice. Midwives can use trimester-specific risk factors to tailor their screening at each stage of pregnancy, as our research suggests that while some risk factors remain consistent, others may vary across trimesters. By identifying the most predictive risk factors early, healthcare providers can implement targeted interventions sooner. Moreover, our results indicate that we can accurately identify mothers-to-be who are unlikely to develop PPD, thereby enabling more efficient allocation of healthcare resources to those at higher risk and potentially improving prevention and intervention efforts. It should be noted that, while including second- and third-trimester data only slightly enhances predictive performance, continued monitoring of risk factors throughout pregnancy and into the postpartum period remains essential, as certain symptoms may emerge later.

In summary, this study demonstrates the potential of machine learning models, particularly regularized linear regression techniques, to predict PPD using prenatal data only. The consistent role of depressive symptoms, along with psychological traits such as neuroticism and negative affectivity across trimesters, underscores the need for early mental health screening during pregnancy. By identifying those at risk earlier, healthcare professionals can intervene sooner, improving both maternal and child outcomes. These findings suggest that integrating routine psychological assessments into prenatal care could enhance early detection of PPD risk, allowing for timely referrals to mental health services, ultimately reducing the prevalence and impact of PPD.