ResearchBMJ Public Health · Aug 25, 2026

Machine learning models for predicting new-onset diabetes following acute pancreatitis using real-world data

Ba DM, Vafaei Sadr A, Zhang Y, Hart PA, Raja-Khan N, Zhou R, et al
Public & Global HealthEndocrinology & DiabetesAdult

Study type: Observational study: it can show a link, but not prove that one thing causes another.

Read the full paper free at PubMed Central ↗

Abstract

Introduction About one-quarter of patients with acute pancreatitis (AP) will develop diabetes mellitus (DM) within 3 years, but risk factors remain unclear. This study aims to determine whether machine learning models (ML) can be trained to accurately predict new-onset DM following AP and identify key clinical features using real-world data. Methods This retrospective cohort study used de-identified data from the TriNetX federated electronic health records (EHR) network from 1 January 2017 to 11 March 2024. A total of 58 746 patients with AP (International Classification of Diseases-10 code K85) and no prior diagnosis of DM were included. New-onset DM following AP was the main outcome of interest. Five ML models were trained across four prediction windows, including logistic regression (LR), eXtreme Gradient Boosting, Adaptive Boosting, Random Forest and support vector machine. Model performance was assessed using the area under the receiver operating characteristic curve (AUROC). Results Among the 58 746 patients with AP (mean (SD) age, 50.2 (16.6) years), the LR model demonstrated the highest overall performance, with a mean accuracy of 0.72 (SD, 0.009) and an AUROC of 0.79 (SD, 0.009). Key clinical features across models included age, pancreatic necrosis, body weight, body mass index, systolic blood pressure, number of medical visits and prior AP laboratory values such as glucose, anion gap, blood urea nitrogen (BUN) and total protein. Conclusions In this first real-world evidence study using EHR data, we have developed and demonstrated the feasibility of using ML to predict the new onset of DM after AP. Clinical features such as age, pancreatic necrosis, prior glucose, BUN and anion gap had the highest overall importance scores and may inform tailored prevention strategies.

Abstract reproduced under the article’s CC BY NC licence.

More on this topic

AI in medicine

DOI: 10.1136/bmjph-2025-004661 · PubMed: 42688606

Cite this article

Ba DM, Vafaei Sadr A, Zhang Y, et al. Machine learning models for predicting new-onset diabetes following acute pancreatitis using real-world data. BMJ Public Health. 2026;4(3):e004661. doi:10.1136/bmjph-2025-004661

RIS (EndNote, Zotero, Mendeley)BibTeX

Spotted a mistake? Suggest a correction

Top Public & Global Health studies every Monday

The week’s key trials and guidelines, free to read, in one short email. No account; unsubscribe in one click.

Choose specialties and topics

More in Public & Global Health

Review · Lancet Glob Health · Nov 27, 2026 · Public & Global Health

Obligation ledger proposed to track fairness in health system resilience efforts

Research · BMJ Glob Health · Nov 26, 2026 · Public & Global Health

Scoping review maps 26 studies on violence reduction in post-conflict settings

Research · BMJ Open Respir Res · Nov 26, 2026 · Pulmonology, Public & Global Health

Long-term mortality trends in COPD: a nationwide cohort study, 1983-2018

Research · BMJ Public Health · Nov 26, 2026 · Public & Global Health

Age and education linked to disability prevalence in 46,299 Malawian adults

Research · BMJ Public Health · Nov 26, 2026 · Public & Global Health

African public health agencies published 512 papers on emergencies, mostly on HIV and COVID-19