Establishment of the China Elderly Comorbidity Medical Database (CECMed) and its application in machine learning-based prediction Authors: Jingwen Shi, Duanchang Wan, Wen Tang, Xuedong Wang, Longyu Li, Wei Chen, Bing Liu, Xuebing Yang, Ying Sun Published: 2026 ABSTRACT AimsComorbidity is highly prevalent in the elderly in China, representing a leading cause of mortality in this population. This study established a multicenter dataset specific to geriatric comorbidities and explored the performance in early warning of in-hospital adverse events using multiple machine learning models.Methods and resultsData were collected in the elderly from northern, central, and southern regions of China. Following data processing, a dataset specific to geriatric comorbidities was established. Among the patients, over 90% had at least one geriatric syndrome. Machine learning methods were applied to predict adverse events during hospitalization, including Random Forest, Support Vector Machine (SVM), 1-Dimensional Convolutional Neural Network (1D CNN), Gradient Boosting Decision Tree (GBDT), and eXtreme Gradient Boosting (XGBoost). GBDT (AUROC = 0.91, ACC = 0.903, REC = 0.878, PRE = 0.808, F1 = 0.836) and XGBoost (AUROC = 0.914, ACC = 0.91, REC = 0.893, PRE = 0.817, F1 = 0.848) demonstrated better prediction performance. Shapley Additive Explanation (SHAP) method was used to identify features significantly associated with the occurrence of adverse events and presented the top ten features based on their significance.ConclusionsA geriatric comorbidity-specific dataset was established. XGBoost demonstrated the better performance in predicting risk of in-hospital adverse events. Frailty, D-dimer, disease severity grade, Barthel Index, and fibrin degradation products were significantly associated with the occurrence of such events.Supplementary InformationThe online version contains supplementary material available at https://doi.org/10.1186/s12877-026-07820-0. Introduction The global increase in the aging population presents an increasing challenge for health systems. According to the United Nations Population Division [1], approximately 60% of the elderly in China are projected to require long-term care by 2050. This demand is driven largely by complex health profiles. The complex interplay between psychological and physical conditions, coupled with the rising incidence of geriatric syndromes, complicates clinical decision-making and elevates the risk of adverse events in the elderly [2]. 30%-83% of the elderly are affected by two or more chronic conditions, which is associated with an increased risk of reduced quality of life, polypharmacy, falls, and all-cause mortality [3]. Given the high prevalence and mortality of chronic conditions (e.g., hypertension, diabetes, and coronary heart disease), understanding comorbidity patterns has become a relevant focus in public health research. Currently, artificial intelligence (AI) has been increasingly applied in medicine, particularly in medical image analysis and disease diagnosis [4–7]. AI has offered increased convenience for patients and enhanced efficiency of medical practice [8, 9]. Furthermore, AI promises to alleviate the burden on healthcare systems and contribute to sustainable social development. Recent international research has used large‑scale datasets to characterize chronic diseases in relatively younger populations [10]. While in China, research has primarily focused on constructing multidimensional datasets to quantify epidemiological patterns [11]. However, these valuable datasets have not yet been fully leveraged by advanced machine learning algorithms to generate actionable clinical insights. This study aimed to address this issue by establishing a comprehensive dataset specific to the elderly with comorbidities in China. This dataset enabled AI-driven prediction and early warning of adverse clinical events in this vulnerable population. A multi-center, bidirectional, and anonymized database, involving data collection, processing, detailed characterization, and application modules, was developed for the elderly with comorbid chronic diseases in China. By employing raw data de-identification, systematic data re-organization and encoding, and AI frameworks, this dataset enabled accurate AI-driven prediction and early warning of adverse clinical events in this vulnerable population (Fig. 1). Fig. 1Graphical abstract Graphical abstract Materials and methods Patients A multi-center, bidirectional, and anonymized dataset specific to the elderly with comorbid chronic diseases in China, termed China Elderly Comorbidity Medical Database (CECMed), was developed. Centers contributing to this dataset include Beijing Friendship Hospital Affiliated Capital Medical University, Fuwai Hospital Affiliated Chinese Academy of Medical Sciences, The First Affiliated Hospital of Zhengzhou University, and Guangzhou Huyun Medical Technology. The hospitals were selected using a stratified random sampling method to ensure representation across different geographic and economic levels in China. Patient enrollment for retrospective cohort study spanned from January 2010 to January 2022, while that for prospective cohort study spanned from January 2022 to November 2023. Inclusion criteria: (1) age ≥ 65 years [11]; (2) presence of at least one of the following five chronic diseases: coronary heart disease (CHD), hypertension, diabetes, chronic obstructive pulmonary disease (COPD), and osteoporosis [12]. Exclusion criteria: (1) late-stage malignant tumors or expected survival time less than 3 months; (2) complete disability, and inability to communicate; (3) inability to cooperate with follow-up; (4) adverse event developed ≤ 24 h after admission. A total of 5,863 patients were ultimately included in the final cohort (Fig. 2). Fig. 2 Flowchart for study participant selection Fig. 2 Flowchart for study participant selection Data collection Data were collected at admission and during hospitalization, including demographics and anthropometrics, vital signs and functional assessments, blood routine and coagulation parameters, biochemistry and metabolic panel, organ function and enzymes. Adverse events were recorded during hospitalization. Besides, all patients underwent a comprehensive geriatric assessment using Barthel Index, FRAIL (Fatigue, Resistance, Ambulation, Illnesses, and Loss of Weight Scale), MORSE (MORSE Fall Scale), MNA-SF (Mini Nutritional Assessment Short-Form), and MINI-cog (MINI-cog Cognitive Assessment Scale). Patient functional status was assessed within 24 h of admission. Variables Variables included age, gender, body mass index (BMI), smoking status, alcohol consumption, educational level, heart rate, pulse, systolic blood pressure, body temperature, breath, pulse oximetry, pain, Barthel index, FRAIL score, MINI-cog score, MNA-SF score, MORSE score, disease staging, New York Heart Association (NYHA) functional classification, white blood cell count, absolute neutrophil count, absolute lymphocyte count, platelet, hemoglobin, prothrombin time activity, international normalized ratio (INR), activated partial thromboplastin time (APTT), fibrinogen, fibrin degradation products, D-dimer, albumin, albumin/globulin ratio, creatinine, urea, uric acid, sodium, potassium, calcium, carbon dioxide, osmolality, lactic acid, ketones, fasting blood glucose (FBG), random blood glucose (RBG), HbA1c, total cholesterol, triglycerides, high-density lipoprotein cholesterol (HDL-C), low-density lipoprotein cholesterol (LDL-C), aspartate transaminase (AST), alanine transaminase (ALT), gamma-glutamyl transferase (GGT), alkphosphatase (ALP), total bilirubin, direct bilirubin, indirect bilirubin, creatine kinase (CK), creatine kinase isoenzyme (CK isoenzyme), lactate dehydrogenase (LDH), cardiac troponin I, cardiac troponin T, and high-sensitivity C-reactive protein (hs-CRP) (Supplementary Table 1). Age, gender, smoking status, alcohol consumption, educational level, and history of disease were acquired using self-report questionnaires. Responses were recorded as “yes” or “no”. Smoking status was defined as current smoker or past smoker (had smoked 100 or more cigarettes in the past). Alcohol consumption was defined as alcohol consumption at least once per week or last alcohol consumption at least six months ago. BMI was calculated using the following formula: BMI = body weight (kg) / height squared (m2). All laboratory parameters were measured using fasting venous blood samples drawn in the morning. Geriatric syndromes A comprehensive geriatric assessment involving daily living activities, frailty, fall risk, malnutrition, and cognitive function was performed. Daily living activities: Barthel Index was used to rate independence in 10 basic activities of daily living, including feeding, bathing, grooming, dressing, toileting, wheelchair mobility, transfers, stairs, bowel and bladder control. Scores ranging from 0 to 60 were categorized as moderate dependence, while scores ranging from 61 to 100 were categorized as mild dependence or independence. Frailty: The FRAIL scale, which includes fatigue, resistance, ambulation, illness, and loss of weight, was used to assess frailty status: not-frail (score: 0), pre-frail (score: 1–2) and frail (score: 3–5). Fall risk: The MORSE scale, including history of falling, medical conditions, walking ability, use of intravenous equipment, cognitive status, and gender, was adopted to analyze fall risk. Patients were classified into low-risk (socre: < 25), moderate-risk (score: 25–44) or high-risk (score: ≥45) groups based on scores. Malnutrition: The MNA-SF scale mainly includes weight changes, dietary intake, functional abilities, psychological status, age, and BMI. This scale was used to assess the nutritional status of participants: normal nutritional status (score: 12–14), risk of malnutrition (score: 8–11), and malnutrition (score: 0–7). Cognitive function: The MINI-cog scale, including memorial test and clock drawing task, was adopted for cognitive assessment: cognitive dysfunction (score: 0–2) and normal cognitive function (score: 3–5). Adverse events Adverse events included respiratory adverse events, major adverse cardiac and cerebrovascular events (MACCE), thromboembolic-related adverse events, and significant adverse events in the whole disease course in-hospitals. Respiratory adverse events comprised pulmonary infections, respiratory failure, and acute exacerbation of chronic obstructive pulmonary disease. MACCE included acute coronary syndrome, recurrent revascularization, acute hemorrhagic stroke, acute ischemic stroke, cardiovascular death, malignant arrhythmias, acute heart failure, and acute exacerbation of chronic heart failure. Significant adverse events mainly included all-cause mortality event, gastrointestinal bleeding events, fracture events, and infection-related events. Thromboembolic-related adverse events primarily included pulmonary embolism and deep venous thrombosis of the lower extremities. All-cause mortality event was defined as death from any causes. Gastrointestinal bleeding events were defined by hemoglobin drop by ≥ 3 g/dl, requirement of transfusion, or treatment in the hospital. Infection-related events were infections that require treatment in the hospital. Fracture events were limb skeletal fracture events supported by clear image. Prediction time frame and data leakage prevention To ensure a valid temporal sequence, prediction baseline was defined as the time of hospital admission. Only variables available within the first 24 h post-admission were included as predictors. Patients who experienced the outcome of interest prior to this baseline (i.e., within the first 24 h) were explicitly excluded. Among 6,693 patients, 175 (2.7%) developed adverse events within the first 24 h and then were excluded from the primary analysis to avoid data leakage. Data extraction and processing Data were collected from different hospitals and communities and pooled into a designated database. All data were collected using standardized definitions. Data extraction The multimorbid cohort system comprised two parts: Self-Constructed Electronic Medical Record Dataset and Big Data Platform Dataset. The former was constructed based on data from multiple medical institutions through the Self-constructed electronic medical record platform. The latter was unique to Beijing Friendship Hospital. The system applied unique patient identifiers to integrate relevant clinical data fields from heterogeneous medical record forms of individual patients, and then aggregate multi-institutional electronic health records within a Self-constructed electronic medical record platform into a unified data table. The patient identifiers from the Self-Constructed Electronic Medical Record Dataset were used to extract the corresponding patients from the Big Data platform. In compliance with the data security requirements of GB/T 22,239, a separate mapping table was used to link the patient identifier to a unique patient code, ensuring confidentiality and full anonymization of the dataset and in turn protecting patient privacy. Data processing Following initial data collection and integration, data processing including deduplication, outlier detection, and timestamp standardization was performed to construct the first version of the dataset (dataset 1). This dataset comprised numerical, categorical/ordinal, and textual features, retaining all non-personally identifiable patient information. To enhance its utility for researchers, comprehensive feature engineering was carried out, contributing to a second version (dataset 2). Specifically, one-hot encoding was applied for categorical variables. Named Entity Recognition (NER) was used to extract medical entities from text, which were subsequently mapped to standardized ATC and ICD codes. Researchers can visit dataset 2 directly for experiments or reprocess dataset 1 according to their own requirements. Notably, missing values were intentionally preserved in both dataset versions to prevent the introduction of bias or misleading artifacts. Lead time Lead time was defined as the time interval between the prediction baseline (admission or 24 h after admission) and the occurrence of the first adverse event. Experimental study Machine learning models were built to evaluate the ability of the dataset in predicting adverse events. The predicted adverse events were composite adverse events, rather than a specific single adverse event. The task aimed to predict the occurrence of an adverse event during hospitalization based on patient characteristics, which was framed as a binary classification problem. A total of 64 features were selected from the Self-Constructed Electronic Medical Record Dataset and the Big Data Platform Dataset for modeling purposes (Supplementary Table 2). A multiple imputation method was adopted to handle missing data. Synthetic minority oversampling technique (SMOTE) was applied to address class imbalance, and cross-validation was used to ensure the model did not bias toward the majority class. Regarding time-series features, only the record with the nearest timestamp relative to admission was retained, provided that the measurement was recorded within 24 h prior to admission. This strategy was adopted because measurements proximal to admission are considered to best reflect the baseline physiological status of patients at the time of hospitalization. Five classic metrics were used to evaluate performance, including Area Under the Receiver Operating Characteristic Curve (AUROC), Accuracy (ACC), Precision (PRE), Recall (REC), and the F1 Score (F1). Averages from 5-fold cross-validation were reported to ensure reliability of the experiment. All metrics were positively oriented. The dataset was partitioned into 5 folds using stratified random sampling. A patient-level grouping strategy was employed to prevent data leakage, ensuring that records from the same patient were not split across the training and test sets. All samples corresponding to a single patient were exclusively assigned to either the training or the test subset within each fold. Hyperparameter optimization was performed on a validation set derived from the training fold. Friedman test was conducted with cross-validation folds treated as blocks to assess statistical significance. Five classic machine learning methods, including Random Forest (an ensemble of decision tree), Support Vector Machine (SVM), 1D Convolutional Neural Network (CNN), Gradient Boosting Decision Tree (GBDT), and eXtreme Gradient Boosting (XGBoost), were adopted and compared. A uniform data interpolation approach was consistently implemented across all methods to address missing data. Results Dataset composition and five chronic diseases A total of 5,863 patients from hospitals and communities all over the country were enrolled, including 3,157 (53.85%) males and 2,706 (46.15%) females. The mean (SD) age was 75.44 ± 7.83 years (range: 65–103 years). There were 4,583 patients with hypertension, 2,250 with diabetes, 1,375 with COPD, 4,245 with CHD, and 1,486 with osteoporosis (Supplementary Fig. 1). Given the high prevalence of multimorbidity in the elderly, substantial overlap existed among these diseases: one comorbidity only in 897 patients (15.3%), two comorbidities in 2,337 (39.9%), three comorbidities in 2,056 (35.1%), four comorbidities in 521 (8.9%), all five comorbidities in 52 (0.9%). Comorbidity analysis Strong correlations were found between specific chronic conditions. Hyperuricemia (HUA) was strongly associated with renal disease (φ = 0.22, OR = 8.19, p < 0.001). CHD showed a high degree of comorbidity with hyperlipidemia (φ = 0.31, OR = 4.37, p < 0.001). Chronic Heart Failure (CHF) was associated with renal disease (φ = 0.08, OR = 4.92, p < 0.001). These findings supported the significant clustering within the comorbidity network (Supplementary Fig. 2A and Supplementary Table 4). Additionally, it was revealed that comorbidities were closely associated with common geriatric syndromes including frailty and fall risk. More than 90% patients had at least one geriatric syndrome, particularly comorbidities and fall risks (Supplementary Fig. 2B). Geriatric syndromes A comprehensive geriatric assessment using the Barthel Index, FRAIL scale, MORSE scale, MNA-SF, and Mini-Cog was conducted, which helped to increase our understanding of the functional ability, frailty, fall risk, nutritional status, and cognitive function in the elderly. Results showed that 14.6% patients were categorized as dependence in functional ability, 22.1% patients were frail, 80.6% patients were at high risk of falls, 3.4% patients with malnutrition, and 13.7% patients had cognitive dysfunction (Supplementary Table 3). Adverse events Patient conditions were classified by experienced physicians 24 h before hospitalization. Patients were classified as mild (n = 1,661), moderate (n = 2,144), severe (n = 1,089), and missing (n = 70) (Supplementary Fig. 3A). Adverse events were found during hospitalization, including respiratory adverse events (n = 152), MACCE (n = 90), thromboembolic-related adverse events (n = 49), and significant adverse events (n = 185) (Supplementary Fig. 4). The median lead time from prediction baseline to the occurrence of a first adverse event was 52.3 h (mean ± SD: 52.3 ± 28.1 h), ranging from 6 h to 168 h. Clinical outcomes included not recovery (n = 83), deterioration (n = 5), and death (n = 83) (Supplementary Fig. 3B). AI-based prediction Performance of machine learning models Experimental results are presented in Table 1. XGBoost achieved the best performance across all 5 evaluation metrics. Comparison with GBDT, the second-best algorithm, revealed improvement of the five metrics by 0.44%, 0.78%, 1.71%, 1.11%, and 1.44%, respectively, by XGBoost. The confusion matrix for all methods was visualized (Fig. 2). All models performed well in predicting true positives. XGBoost exhibited the highest number of true positives (865) and the lowest number of false negatives (78), followed by Random Forest and GBDT. Thus, XGBoost and GBDT were likely the best-performing models, particularly for applications where minimizing both false positives and false negatives was critical. Table 1Experimental results of five baseline methodsBaselineAUROCACCPRERECF1RandomForest0.9070.8920.8710.7770.812SVM0.8410.8510.7950.7010.7311DCNN0.8510.8450.7730.7140.736GBDT0.910.9030.8780.8080.836XGBoost 0.914 0.91 0.893 0.817 0.848 Table 1Experimental results of five baseline methodsBaselineAUROCACCPRERECF1RandomForest0.9070.8920.8710.7770.812SVM0.8410.8510.7950.7010.7311DCNN0.8510.8450.7730.7140.736GBDT0.910.9030.8780.8080.836XGBoost 0.914 0.91 0.893 0.817 0.848 Experimental results of five baseline methods Fig. 3The confusion matrices of both baseline methods The confusion matrices of both baseline methods Feature importance analysis Shapley Additive Explanation (SHAP) framework was applied for feature importance quantification. Attributed attaining elevated SHAP values exhibited amplified causal contributions to the model’s predictive mechanism. The top 10 most influential features for predicting adverse events were obtained (Fig. 3). Frailty ranked first with the highest SHAP value. Patients with higher FRAIL scores were more likely to experience adverse events during hospitalization. D-dimer took second place with a considerable impact. Features, including disease staging, Barthel Index, and fibrin degradation products, also had significant SHAP values, indicating their role as powerful predictors of adverse outcomes. These findings underscored the significance of the features and functional assessment in predicting adverse events, providing valuable insights to help physicians manage patient care more effectively. Fig. 4SHAP value of the machine learning model output SHAP value of the machine learning model output Statistical analysis To assess the difference between the performance of the five machine learning models across multiple evaluation metrics, statistical analysis with five distinct random seeds was carried out. For each random seed, Friedman test was performed. All Friedman test results yielded P-values below the significance threshold of 0.05 (Table 2). This consistency indicated statistically significant differences in performance across all five models under different random seeds. Among the models evaluated, XGBoost demonstrated the best performance regardless of random seed configuration. Table 2Friedman test results of five baseline methodsGroupp-valueBest_methodGroup00.000892XGBoostGroup10.000499XGBoostGroup20.000772XGBoostGroup30.001031XGBoostGroup40.000959XGBoost Table 2Friedman test results of five baseline methodsGroupp-valueBest_methodGroup00.000892XGBoostGroup10.000499XGBoostGroup20.000772XGBoostGroup30.001031XGBoostGroup40.000959XGBoost Friedman test results of five baseline methods Discussion As the global population ages, the number of elderly people is expected to reach 2 billion by 2050, imposing an increasing burden on society. A minority of studies in the elderly with comorbidities in China are single-center studies [13–15]. Most studies use data from the China Health and Retirement Longitudinal Study (CHARLS) [16, 17]. CHARLS is the most widely used aging-related database in China, comprising multicenter cohorts that collect information from adults aged 45 years and older through questionnaire surveys. This database covers demographics, health status and functioning, biomarkers, retirement and pension, income and consumption, etc. In addition, it is characterized by large sample sizes and long-term follow-up, supporting numerous data mining studies. However, information from the CHARLS is predominantly community-acquired and self-reported, resulting in susceptibility to information bias. There is a lack of hospital-associated information and real-time data of adverse events during disease course. Moreover, the data documented in the CHARLS are not specific to the elderly, which limits its ability to capture the clinical complexity and acute changes in elderly patients with chronic conditions. Other independently developed datasets focusing on comorbidities are often single-center and similarly lack systematic coverage of older populations. Consequently, there is a notable scarcity of high-quality, hospital-based comprehensive databases for geriatric comorbidity in China. Also, research on in-hospital early warning systems and intelligent decision support for this population remains insufficient. This study established a geographically extensive dataset for the elderly with comorbidities, covering the northern, central, and southern regions of China. This dataset integrated complete disease-course data, detailed clinical parameters, and comprehensive geriatric assessments, providing a rich resource for multimorbidity research and enabling in-hospital early warning for adverse events. Chronic conditions such as hypertension, diabetes, CHD, and COPD are highly prevalent in the elderly [13, 18]. Evidence suggests that these conditions collectively account for over 80% of the chronic disease burden and are significantly associated with all-cause mortality in both community-dwelling and hospitalized older populations [19]. Building upon these findings, the present dataset was constructed to encompass five major chronic conditions: hypertension, diabetes, CHD, COPD, and osteoporosis, aligning closely with the established prevalence patterns of chronic diseases in the elderly. Additionally, this dataset enables investigation into the prognosis associated with each condition and the interrelationship between different chronic diseases, thereby advancing our understanding of multimorbidity. Such insights not only inform the scientific management of the elderly with comorbid conditions but also carry important implications for optimizing clinical decision-making in this high-risk population. AI has become increasingly common in construction of medical databases. Through continuous learning and training, it has been widely used in many fields such as disease diagnosis [20–25], home monitoring [21, 26], image interpretation [27, 28] and gene sequencing [29]. This study introduced a self-established multicenter dataset for elderly patients with comorbidities and evaluated the performance in predicting in-hospital adverse events using multiple machine learning models. The model with the highest stability was identified. Meanwhile, significance of different features in predicting occurrence of in-hospital adverse events was analyzed, hoping to identify key features that can guide the management of elderly patients with comorbidities during hospitalization. Machine learning models have been increasingly utilized in medical research, with applications ranging from forecasting breast cancer metastasis risk [30] and predicting prognosis in patients with hepatocellular carcinoma following transarterial chemoembolization or intra-arterial chemotherapy [31] to estimating the likelihood of acute respiratory distress syndrome after cardiac surgery [32]. The present study applied comparable machine learning approaches to predict in-hospital adverse events, including Random Forest, SVM, 1D CNN, GBDT and XGBoost. Among these models, XGBoost demonstrated the strongest prediction performance across all metrics (AUROC, ACC, PRE, REC, and F1). SHAP analysis revealed that frailty, D-dimer, disease severity grade, Barthel Index, and fibrin degradation products contributed most significantly to the occurrence of in-hospital adverse events in elderly patients with comorbidities. Frailty is a comprehensive reflection of overall physiological status. Relevant studies indicated that frail elderly patients with comorbidities experienced more pronounced chronic inflammation and oxidative stress, with an increased risk of adverse outcomes. These studies also suggested that frailty should be incorporated into the management framework for elderly patients with comorbidities [33–35]. Prolonged bed rest is common in elderly patients with comorbidities, often leading to hemodynamic disturbances and microcirculatory dysfunction. In addition, the underlying disease state can impair coagulation function, further exacerbating coagulation abnormalities and increasing the risk of thrombosis-related adverse events. These factors may explain why coagulation-related markers, such as D-dimer and fibrin degradation products, contributed substantially to the prediction of in-hospital adverse events in this study. However, further validation is required. Skeletal muscle is the largest motor organ in the human body. Decline in skeletal muscle function directly impairs physical mobility, resulting in lower Barthel Index and increased risk of in-hospital adverse events. In the present study, chronic conditions common in the elderly, such as hypertension, diabetes, CHF and CHD, were included for analysis. These conditions share key pathogenic mechanisms, including chronic inflammation, oxidative stress, and insulin resistance [36–38], all of which contribute to impairment of skeletal muscle function. These features may explain the substantial contribution of reduced mobility to the risk of in-hospital adverse events in this population. To our knowledge, this study established the first multicenter dataset in China, with a specific focus on geriatric comorbidity. Meanwhile, this study represents an initial attempt to apply machine learning methods to predict the risk of in-hospital adverse events in the elderly with comorbidities. However, several limitations should be acknowledged. First, the dataset has limited geographic coverage, regardless of its multi-center design. This limitation may affect the representativeness of the sample. Second, variables included in the machine learning models were selected mainly based on clinical experience and findings from previous literature, leaving open the possibility that other unmeasured factors may influence model outcomes. Third, geriatric assessments were conducted by different evaluators across centers, introducing subjectivity and potential bias into the results. Fourth, certain key variables, such as laboratory parameters, were measured according to varying standards across institutions, which may compromise the generalizability of the model. Fifth, this study demonstrated the feasibility of the application of machine learning models in dataset construction, but it did not place emphasis on baseline comparisons, pending further verification. Finally, validation of the model using external datasets requires additional investigation. Conclusion This study established the first dataset specific to geriatric comorbidity in China. Within this dataset, XGBoost demonstrated strong performance in predicting risk of in-hospital adverse events. Frailty, D-dimer, disease severity grade, Barthel Index, and fibrin degradation products were significantly associated with the occurrence of such events. These findings may facilitate in-hospital management of elderly patients with comorbidities and help to reduce the incidence of in-hospital adverse events. Supplementary Information Supplementary Material 1. Supplementary Material 1.