Skip to main content


Log in

Prenatal and Childbirth Risk Factors of Postpartum Pain and Depression: A Machine Learning Approach

  • Published:
Maternal and Child Health Journal Aims and scope Submit manuscript



About 74.91% of U.S. mothers experience postpartum pain at 6 to 10 weeks postpartum, and one in seven U.S. mothers suffer from postpartum depression. We used machine learning to explore physical, psychological, and social factors during pregnancy and childbirth and identify the most important predictors of postpartum pain and depression.


Data were from the Listening To Mothers III survey (2012), a national representative sample of postpartum mothers. We randomly split the dataset into a training set (N = 1467) and a test set (N = 723). The final models included 34 risk factors identified from previous literature. Postpartum pain was measured as “to what extent the pain interferes with mothers’ daily life”. PHQ2 scores measured depression. We used the random forest model, an aggregate of many regression trees, to accommodate potential nonlinear/interaction effects.


In the test data set, our models explained 15.8% of the variance in pain and 27.1% of the variance in depression. The model’s strongest predictors for postpartum pain were Cesarean delivery, holding back while communicating with providers, non-use of pain relief medications, and perceived discrimination. For depression scores, the model’s strongest predictors included needing help for depression during pregnancy, perceived discrimination, holding back, gestational diabetes, and pain.

Conclusions for Practice

Mental and physical health are intertwined and should be considered integratively in the perinatal period. Besides, practitioners should also be aware of the importance of patient-provider-relationship, which both independently and interact with other risk factors to predict postpartum health.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8

Data Availability

The data used in this study are publicly available at

Code Availability

Code are available by contacting author YL at


  1. The permutation importance measures capture the importance of each variable. To compute it, we first randomly shuffled values in one variable and made predictions with rest variables. By comparing the predictions with the actual value, we calculated the permutation importance measures to represent how much model accuracy were lost due to the shuffling of that variable.


Download references


Not applicable.

Author information

Authors and Affiliations



Conceptualization and data curation: WX. Methodology and data analysis: WX. Writing, review and editing: WX and MS.

Corresponding author

Correspondence to Wen Xu.

Ethics declarations

Conflict of interest

The authors declare that they have no conflict of interest.

Ethical Approval

The study was exempted by the University of Houston Institutional Review Board.

Consent to Participate

Not applicable.

Consent for Publication

Not applicable.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Supplementary Information

Below is the link to the electronic supplementary material.

Supplementary file1 (DOCX 38 KB)

Rights and permissions

Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Xu, W., Sampson, M. Prenatal and Childbirth Risk Factors of Postpartum Pain and Depression: A Machine Learning Approach. Matern Child Health J 27, 286–296 (2023).

Download citation

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: