
Predicting Chronic Post-Surgical Pain After Anal Fistula Surgery Using Perioperative Clinical and Anesthesia Data: A Machine Learning Study
J Pain Res. 2026 Nov 11;19:632250. doi: 10.2147/JPR.S632250. eCollection 2026.
ABSTRACT
OBJECTIVE: To develop and internally evaluate prediction models integrating preoperative clinical characteristics and intraoperative anesthesia and surgical data to estimate the risk of chronic postsurgical pain (CPSP) 3 months after anal fistula surgery, with the aim of informing risk-stratified postoperative nursing care and follow-up.
METHODS: This retrospective cohort study included 779 patients who underwent anal fistula surgery between January 2023 and June 2025. CPSP was assessed 3 months after surgery. The dataset was randomly divided into a training set (70%; n = 545) and a held-out test set (30%; n = 234). Candidate variables were screened using univariable analysis and least absolute shrinkage and selection operator (LASSO) regression. Logistic regression, random forest (RF), extreme gradient boosting (XGBoost), and support vector machine (SVM) models were developed, with 10-fold cross-validation used during model development; final performance was assessed in the held-out test set. Discrimination was evaluated using the area under the receiver operating characteristic curve (AUC); calibration, decision curve analysis (DCA), and Shapley additive explanations (SHAP) were used to assess calibration, potential net benefit, and predictor contributions, respectively.
RESULTS: CPSP was identified in 63 of 779 patients (8.1%). LASSO retained eight predictors: fistula type, previous perianal surgery, preoperative pain, operative time, anesthesia duration, surgical grade, ASA physical status, and anesthesia technique. Test-set AUCs were 0.834 (95% CI, 0.741-0.917) for logistic regression, 0.823 (0.724-0.902) for RF, 0.836 (0.751-0.923) for XGBoost, and 0.783 (0.684-0.864) for SVM. XGBoost and logistic regression had similar discrimination, with Brier scores of 0.067 and 0.066, respectively. DCA suggested potential net benefit over portions of the assessed threshold range. In the XGBoost SHAP analysis, fistula type, preoperative pain, and operative time made the largest reported contributions; complex fistula, previous perianal surgery, and higher surgical grade were associated with higher model-predicted risk.
CONCLUSION: Models based on preoperative clinical and intraoperative anesthesia and surgical data showed promising discrimination for CPSP at 3 months after anal fistula surgery. XGBoost and logistic regression performed comparably in the test set. Following external validation, such models may assist in identifying patients who warrant closer postoperative pain assessment, individualized nursing attention, and follow-up; their impact on patient outcomes remains to be established.
PMID:43041816 | PMC:PMC13771633 | DOI:10.2147/JPR.S632250
