BACKGROUND: Once considered a disease observed in older adults, type 2 diabetes is now increasingly seen in youth and adolescence. Young-onset (<40 years of age) type 2 diabetes progresses more rapidly than late-onset disease, but remains frequently underdiagnosed due to scarce screening and frequent misclassification. We aimed to develop a prediction model for young-onset type 2 diabetes to improve detection and reduce long-term health-care burden. METHODS: For this nationwide, retrospective cohort study, we constructed a deep learning-based prediction algorithm for young-onset type 2 diabetes driven by routine care data from both primary and secondary health-care sectors. We used this model to predict future risk at multiple time horizons spanning 0-24 months using data on previous hospital diagnoses, primary care prescriptions, and primary care health service events from nationwide Danish health registries. FINDINGS: The algorithm was trained on patient health trajectories from 3 435 638 individuals, of whom 16 828 developed young-onset type 2 diabetes between Jan 1, 1995, and Dec 31, 2018. The 0·1% highest-risk individuals had a relative risk of 118·1 (95% CI 113·1-122·5) compared with the general population when predicting type 2 diabetes debut 3-15 months after the date of assessment, with 0·23% (0·22-0·24) of cases detected at 5% positive predictive value threshold, and relative risk decreased to 74·6 (71·2-78·2) at 12-24 months. Using both primary and secondary care registries increased performance over models trained on data from single registries with the best single-registry model, achieving a relative risk of 97·2 (92·9-101·7) at 3-12 months to 50·0 (46·9-53·3) at 12-14 months. Cross-replication in each of the five Danish regions showed consistent performance and robustness to regional health-care differences. Model explainability revealed emphasis on both well established risk factors and other factors previously linked mainly to late-onset type 2 diabetes, with cardiovascular prescriptions proving to be a strong indicator of time to diabetes. INTERPRETATION: This study highlights the potential for using deep learning methods on longitudinal health data from both primary and secondary care to develop low-cost predictive tools for screening of young-onset type 2 diabetes. FUNDING: Novo Nordisk Foundation.
Johansen et al. (2026) studied this question.