Identifying patients requiring treatment for depression in the postpartum period from common electronic medical record data available antepartum using machine learning

Objective: Depression requiring treatment in the postpartum period (PPD) significantly impacts maternal and neonatal health. While preventive management of depression in pregnancy has been shown to decrease the negative effects, current methods for identifying at-risk patients are insufficient. Given the complexity of the diagnosis and interplay of clinical/demographic factors, we tested if machine learning (ML) techniques can accurately identify patients at risk of PPD. Study Design: This is a retrospective cohort study of the NIH Nulliparous Pregnancy Outcomes Study (nuMoM2b) which enrolled 10,038 nulliparous people. The primary outcome was PPD. We constructed and optimized four ML models using distributed random forest modeling based on the nuMoM2b dataset. Model 1 utilized only readily obtainable sociodemographic data. Model 2 added maternal pre-pregnancy mental health data. Model 3 utilized recursive feature elimination to construct a parsimonious model. Model 4 further titrated the input data to exclude pre-pregnancy mental health variables. Results: Of 8454 births, 338 (4%) were complicated by PPD. Model 3 was the highest performing, demonstrating the area under the receiver operating characteristics curve (AUC) of 0.91(+/-0.02). Models 1-3 identified the 9 variables most predictive of depression hierarchically ranging from BMI (highest), prior depression, age, income, medications, education, past medical history, race, and prior anxiety (lowest). In model 4, the AUC remained at 0.80(+/-0.04). Conclusions: Counterintuitively, the presence of pre-pregnancy mental health conditions is not the most predictive factor of PPD. Furthermore, PPD can be predicted with high accuracy for individual patients using antepartum information commonly found in the EMR.