BACKGROUND: Metabolic-bariatric surgery (MBS) is the last effective way to lose weight whom around half of the patients are women of reproductive age. It is recommended an interval of 12 months between surgery and pregnancy to optimize weight loss and nutritional status. Predicting pregnancy up to 12 months after MBS is important for evaluating reproductive health services in bariatric centers
therefore, this study aimed to present a prediction model for pregnancy at the first year following MBS using machine learning (ML) algorithms. METHODS: In a nested case-control study of 473 women with a history of pregnancy after MBS during 2009-2023, predisposing factors in pregnancy within 12 months after MBS were identified and subsequently, several ML models, including the classification algorithms and decision trees, as well as regression analyses, were applied to predict pregnancy up to 12 months after MBS. RESULTS: The highest area under the curve (AUC) was 0.920 ± 0.014 (95%CI 0.906, 0.927) for the C5.0 decision tree with sensitivity and specificity of 0.762 ± 0.044 (95%CI 0.739, 0.801) and 0.916 ± 0.028 (95%CI 0.883, 0.922), respectively. This model considered thirteen important factors to predict pregnancy at the first 12 months following MB, including menstrual irregularity, marital status, a history of abnormal fetal development, age, infertility type, parity, gravidity, fertility treatment, presurgery body mass index (BMI), infertility, infertility duration, polycystic ovary syndrome (PCOS), and type 2 diabetes (T2DM). CONCLUSION: Developing the ML models, which predict pregnancy within 12 months after MBS, can help bariatric surgeons and obstetricians to prevent and manage suboptimal surgical response and adverse pregnancy outcomes.