PurposeThis study aimed to develop prediction models for chronic postsurgical pain (CPSP) after breast cancer surgery using machine learning approaches and evaluate their performance.MethodsThe study was a secondary analysis based on a high-quality dataset from a randomized controlled trial (NCT00418457), including patients with primary breast cancer undergoing mastectomy. The primary outcome was CPSP at 12 months after surgery, defined as modified Brief Pain Inventory > 0. The dataset was randomly split into a training dataset (90%) and a testing dataset (10%). Variables were selected using recursive feature elimination combined with clinical experience, and potential predictors were then incorporated into three machine learning models, including random forest, gradient boosting decision tree and extreme gradient boosting models for outcome prediction, as well as logistic regression. The performances of these four models were tested and compared.Results1152 patients were finally included, of which 22.1% developed CPSP at 12 months after breast cancer surgery. The 6 leading predictors were higher numerical rating scale within 2 days after surgery, post-menopausal status, urban medical insurance, history of at least one operation, under fentanyl with sevoflurane general anesthesia, and received axillary lymph node dissection. Compared with the multivariable logistic regression model, machine learning models showed better specificity, positive likelihood ratio and positive predictive value, helping to identify high-risk patients more accurately and create opportunities for early clinical intervention.ConclusionsOur study developed prediction models for CPSP after breast cancer surgery based on machine learning approaches, which may help to identify high-risk patients and improve patients’ management after breast cancer.