Background: Postpartum depression is a common mental health condition that can occur up to one year after childbirth. Recent studies have increasingly used machine learning techniques to predict its occurrence; however, few have comprehensively explored the use of electronic health record data, particularly in tertiary care settings where such data can be fragmented. Methods: We analyzed electronic health record data from 12,284 women who delivered at The Birth Center at Atrium Health Wake Forest Baptist Medical Center, excluding those with missing data or no prenatal or postpartum visits. To define the target variable, we examined different combinations of depression screening tools (Edinburgh Postnatal Depression Scale and Patient Health Questionnaire-9), along with diagnosis codes specific to postpartum depression. We then trained a random forest classification model to predict postpartum depression. Results: The model achieved an area under the receiver operating characteristic curve of 0.733 ± 0.008, which is comparable to previous studies. Adding socioeconomic features from census tract data did not improve predictive performance, underscoring the importance of individual-level data. Incorporating national survey data, such as the Pregnancy Risk Assessment Monitoring System, also did not improve performance due to limited overlap in data features. Interestingly, model performance was slightly lower among Hispanic patients (area under the curve = 0.713 ± 0.040), although this difference was not statistically significant (p = 0.17), likely due to the small sample size. A similar, but statistically significant trend was observed in the larger national survey dataset (area under the curve = 0.699 ± 0.019 for Hispanic patients versus 0.735 ± 0.010 for White patients, p < 0.01). Conclusions: While our model demonstrates moderate predictive capability, further validation and prospective testing are needed before clinical implementation. This work also identified an optimal approach for digital phenotyping postpartum depression in electronic health record data and highlighted key gaps in data quality and completeness. These findings emphasize the importance of robust data when developing predictive models for real-world clinical use.
Ma et al. (Sat,) studied this question.