BackgroundType 2 Diabetes Mellitus (T2DM) presents a significant healthcare challenge, with considerable economic ramifications. While blood glucose management and long-term metabolic target setting for home care and outpatient treatment follow established procedures, the approach for short-term targets during hospitalization varies due to a lack of clinical consensus. Our study aims to elucidate the impact of pre-hospitalization and intra-hospitalization glycemic indexes on in-hospital survival rates in individuals with T2DM, addressing this notable gap in the current literature.MethodsIn this pilot study involving 120 hospitalized diabetic patients, we used advanced machine learning and classical statistical methods to identify variables for predicting hospitalization outcomes. We first developed a 30-day mortality risk classifier leveraging AdaBoost-FAS, a state-of-the-art ensemble machine learning method for tabular data. We then analyzed the feature relevance to identify the key predictive variables among the glycemic and routine clinical variables the model bases its predictions on. Next, we conducted detailed statistical analyses to shed light on the relationship between such variables and mortality risk. Finally, based on such analyses, we introduced a novel index, the ratio of intra-hospital glycemic variability to pre-hospitalization glycemic mean, to better characterize and stratify the diabetic population.ResultsOur findings underscore the importance of personalized approaches to glycemic management during hospitalization. The introduced index, alongside advanced predictive modeling, provides valuable insights for optimizing patient care. In particular, together with in-hospital glycemic variability, it is able to discriminate between patients with higher and lower mortality rates, highlighting the importance of tightly controlling not only pre-hospital but also in-hospital glycemic levels.ConclusionsDespite the pilot nature and modest sample size, this study marks the beginning of exploration into personalized glycemic control for hospitalized patients with T2DM. Pre-hospital blood glucose levels and related variables derived from it can serve as biomarkers for all-cause mortality during hospitalization.