Background: The weight loss outcomes following bariatric surgery can vary significantly among individuals, making it difficult to predict the extent of weight loss before the operation. In this study, we aimed to develop a machine learning model that could provide personalized predictions of weight loss trajectories for up to 5 years after surgery.

Methods: We conducted a multinational retrospective observational study, enrolling adult participants from ten prospective cohorts and two randomized trials across Europe, the Americas, and Asia. The study included patients who underwent Roux-en-Y gastric bypass, sleeve gastrectomy, or gastric band procedures and had a 5-year follow-up. We excluded patients with a history of previous bariatric surgery or significant delays between scheduled visits. The training cohort consisted of patients from two centers in France. The primary outcome measure was the body mass index (BMI) at 5 years. We employed the least absolute shrinkage and selection operator (LASSO) to select variables and the classification and regression trees algorithm to build interpretable regression trees. The model’s performance was assessed using the median absolute deviation (MAD) and root mean squared error (RMSE) of BMI.

Findings: A total of 10,231 patients from 12 centers across ten countries were included in the analysis, representing 30,602 patient-years. Among the participants, 7,701 (75.3%) were female, and 2,530 (24.7%) were male. From the 434 baseline attributes available in the training cohort, the model selected seven variables: height, weight, intervention type, age, diabetes status, diabetes duration, and smoking status. The model demonstrated good performance across external testing cohorts, with a mean MAD BMI of 2.8 kg/m² (95% CI 2.6-3.0) and mean RMSE BMI of 4.7 kg/m² (4.4-5.0). The mean difference between predicted and observed BMI was -0.3 kg/m² (SD 4.7). To facilitate clinical decision-making, we incorporated the model into an easy-to-use and interpretable web-based prediction tool.

Interpretation: We successfully developed an internationally validated machine learning-based model for predicting individual 5-year weight loss trajectories following three common bariatric interventions. This tool can assist clinicians in making informed decisions before surgery.