Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2025 Apr 17;25(1):168.
doi: 10.1186/s12911-025-03004-9.

A machine learning-based framework for predicting postpartum chronic pain: a retrospective study

Affiliations

A machine learning-based framework for predicting postpartum chronic pain: a retrospective study

Fan Liu et al. BMC Med Inform Decis Mak. .

Abstract

Background: Postpartum chronic pain is prevalent, affecting many women after delivery. Machine learning algorithms have been widely used in predicting postoperative conditions. We investigated the prevalence of and risk factors for postpartum chronic pain, and aimed to develop a machine learning model for its prediction.

Methods: Pregnant women in our tertiary hospital were screened from July 2021 to June 2022. Postoperative pain intensity was assessed using the numerical rating scale at 1, 3, and 6 months after delivery. Six machine learning algorithms were benchmarked using the nested resampling method, and their performance was evaluated based on classification error (CE). The algorithm with the best performance evaluation was used to establish the model for predicting chronic pain 6 months after delivery. Shapley additive explanations analysis was used to assess the contribution of each variable to the model.

Results: A total of 1,398 postpartum women were included for analysis, among whom 383 developed chronic pain 6 months after delivery. The least absolute shrinkage selection operator identified five relevant factors: numerical rating scale at 3 days after delivery, body mass index before delivery, newborn weight, multiparous delivery, and back pain during gestation. The CEs for the algorithms were as follows: K-nearest neighbor, 0.212; logistic regression, 0.342; linear discriminant analysis, 0.343; naive Bayes, 0.346; ranger, 0.219; and extreme gradient boosting model, 0.147. The extreme gradient boosting model exhibited the best performance (CE = 0.147, F1 = 0.851) and was selected for model establishment. Visualization using Shapley additive explanations facilitated the interpretation of the influence of the five variables in the model.

Conclusions: The extreme gradient boosting algorithm, which incorporates five risk factors, demonstrated strong performance in predicting postpartum chronic pain.

Trial registration: https//www.chictr.org.cn/ (ChiCTR2300070514).

Keywords: Cesarean delivery; Machine learning; Pain; Pregnancy.

PubMed Disclaimer

Conflict of interest statement

Declarations. Ethics approval and consent to participate: This study was approved by the Ethics Committee of Xiangyang Central Hospital. All study procedures were performed in accordance with the Declaration of Helsinki. The Ethics Committee of the Xiangyang Central Hospital provided an exempt determination and waived the requirement for informed consent. Consent for publication: Not applicable. Competing interests: The authors declare no competing interests.

Figures

Fig. 1
Fig. 1
Trial flowchart
Fig. 2
Fig. 2
Feature selection for postpartum chronic pain 6 months after delivery with LASSO. (A) The influence of a variable entered into the model earlier is greater than that of a variable entered later. (B) Different values of λ are shown on the x-axis, and the binary deviance is shown on the y-axis. λ min to 1se indicates the acceptable variable
Fig. 3
Fig. 3
Classification error of benchmarking six machine learning algorithms
Fig. 4
Fig. 4
Interpretation of the xgboost models using SHAP. (A) SHAP summary point. (B) feature importance of the variables in the xgboost

Similar articles

References

    1. Haddad-Tóvolli R, Claret M. Metabolic and feeding adjustments during pregnancy. Nat Rev Endocrinol. 2023;19(10):564–80. - PubMed
    1. Robinson DP, Klein SL. Pregnancy and pregnancy-associated hormones alter immune responses and disease pathogenesis. Horm Behav. 2012;62(3):263–71. - PMC - PubMed
    1. Munro A, George RB, Chorney J, Snelgrove-Clarke E, Rosen NO. Prevalence and predictors of chronic pain in pregnancy and postpartum. J Obstet Gynaecol Ca. 2017;39(9):734–41. - PubMed
    1. Yimer H, Woldie H. Incidence and associated factors of chronic pain after caesarean section: A systematic review. J Obstet Gynaecol Ca. 2019;41(6):840–54. - PubMed
    1. Wang X, Wang Y, Zhou S, Wang J, Wang J, Lofstedt P. Women’s postpartum practices and chronic pain in rural China. Matern Child Hlth J. 2009;13(2):206–12. - PubMed

LinkOut - more resources