INTRODUCTION:: Postpartum depression (PPD) affects 1 in 7 women with devastating effects when untreated. To improve compliance with screening recommendations, we used data from patient electronic health records (EHRs) and developed machine learning (ML) algorithms to identify women at high risk of developing PPD who can be preemptively screened. METHODS:: We performed a retrospective study using the EHR data from an academic medical center in New York City (NYC) between January 2015 and June 2018. ML algorithms were applied to calculate the risk for PPD at 12, 18, 24, and 30 weeks of pregnancy gestation, and to compare with real life development of PPD. The algorithms were further validated using the EHR data from the NYC Clinical Data Research Network (NYC-CDRN) between 2004–2017. RESULTS:: Mental Health history and active symptoms, marital status, race, use of beta blockers and antihistamines, and the number of ED visits were among the most predictive features. A total of 15,97 deliveries in the WCM and 53,92 deliveries in the NYC-CDRN were included. The highest area under the curve (AUC) was 0.93 with a sensitivity of 0.83 ad specificity of 0.96. The AUC computed using NYC-CDRN data was 0.853, with the sensitivity at 0.84 and 0.77. CONCLUSION:: Our study validates ML algorithms to predict the risk of developing PPD based on information in the EHR. Our ongoing work is focused on using this approach to facilitate patient-provider communication and decision-making.