A Stacked Ensemble Multi‐Label Model for Predicting Co‐Occurring Microvascular and Macrovascular Complications in Type 2 Diabetes Authors: Maryam Zamani, Maryam Farhadian, Nasrin Piran, Shiva Borzouei Published: 2026 ABSTRACT ABSTRACTBackgroundType 2 diabetes mellitus (T2DM) leads to severe microvascular and macrovascular complications. Traditional single‐label prediction models fail to capture their co‐occurring nature. This study develops a stacked ensemble multi‐label framework that integrates established machine learning techniques into a unified and clinically interpretable approach for the joint prediction of diabetes complications.MethodsIn a retrospective study of 965 T2DM patients, complications were aggregated into microvascular (retinopathy, nephropathy, and neuropathy) and macrovascular (cardiovascular, cerebrovascular) categories. A class‐weighted stacking ensemble integrated three base models—Random Forest, Light GBM, and Cat Boost—within Binary Relevance (BR) and Classifier Chain (CC) frameworks, with a multi‐output logistic regression meta‐learner. Performance was evaluated via 5‐fold cross‐validation (Hamming Loss, F1‐score, area under the curve [AUC]). SHapley Additive exPlanations (SHAP) analysis elucidated risk factors.ResultsThe Stacking‐CC model achieved superior performance, with an overall F1‐score of 0.752 ± 0.049 and AUC of 0.857 ± 0.032. A moderate correlation (r = 0.35) between complications validated the multi‐label approach. SHAP analysis revealed distinct risk profiles: macrovascular complications were strongly associated with LDL cholesterol and diastolic blood pressure, while microvascular complications were linked to drug addiction, fasting blood sugar, and HDL. Conventional factors like age and BMI showed minimal importance.ConclusionThe Stacking‐CC framework effectively models co‐occurring diabetic complications with high accuracy and interpretability. By delineating distinct risk hierarchies, it enables the development of targeted, complication‐specific management strategies. Introduction Diabetes mellitus (DM) remains a substantial problem to global health and is still one of the major causes of morbidity and mortality, mainly through its vascular complications [1, 2]. These complications are categorized differently based on the size of the vessels to the affected area: microvascular complications, which involve small vessels, and macrovascular complications, which involve large arteries. Microvascular complications, particularly retinopathy, nephropathy, and neuropathy, occur because of chronic episodes of capillary damage due to hyperglycemia and can lead to blindness, renal failure, and neuropathic ulcers, respectively. On the other hand, macrovascular disease is marked by accelerated atherogenesis in the large arteries and is thought to account for almost all deaths related to cardiovascular disease among diabetic patients. Both types of complications have common pathogenic mechanisms, such as chronic hyperglycemia and oxidative stress; however, their clinical and pathological manifestations are different. Moreover, a robust two‐way connection is there between them; population‐based data show that the existence or the severity of one type of complication can lead to the onset or worsening of the other [3, 4, 5, 6, 7, 8]. Risk stratification, early intervention, and population health management depend heavily on the accurate prediction of diabetic vascular (DV) complications. Most of the conventional uses of machine learning (ML) in clinical prediction have been a single‐label classification paradigm, which means that an instance is assigned to one exclusive class or category [9, 10]. Nevertheless, this framework is at its core a mismatch with the clinical reality of patients with chronic diseases, for example, DM, who most often have multiple co‐occurring complications. The above clinical situation calls for addressing a more complex and clinically significant issue: multi‐label classification (MLC). Here, a single patient instance is linked to a nonexclusive subset of multiple target labels [11, 12, 13]. Conventional ML models like Random Forest (RF), Light Gradient Boosting Machine (Light GBM) (LGB), and Categorical Boosting (Cat Boost) have been extensively used for this purpose. These machines have different inductive biases, such as RF, which is good at capturing complex, nonlinear relationships but may overfit, Light Gradient Boosting, which is very efficient with large datasets, and Cat Boost, which is strong against categorical features. Still, each model is only a partial representation of the complex pathophysiological interactions in patient data; hence, their performances are limited to a suboptimal level. Ensemble methods, like bagging and boosting, can enhance the performance of a model by lowering its variance or bias; however, they are not capable of combining the different kinds of advantages of two ML algorithms. This limitation is critical in a multi‐label setting, where disparate risk patterns may govern different complications, making a one‐model‐fits‐all approach insufficient [14, 15, 16, 17, 18, 19, 20]. To overcome these limitations, a stacked generalization (stacking) framework is proposed. Our heterogeneous ensemble leverages the diversity of three powerful but distinct base learners, namely, RF, LGB, and Cat Boost, to create a rich set of meta‐features. Then, a second‐level meta‐learner is trained to optimally integrate these predictions, learning the specific contexts in which each base model is most reliable for a given complication type. Consequently, this study has two primary aims. A stacking‐based multi‐label framework for predicting diabetes complications was developed and evaluated. The Binary Relevance (BR) and Classifier Chain (CC) problem transformation strategies were compared to identify the most robust and generalizable approach. Second, a post hoc analysis was performed to identify, rank, and interpret the key risk factors associated with each type of complication to ensure clinical actionability beyond mere prediction. The goal is to develop a model that combines high predictive performance with clinical interpretability. Methods Study Population and Data Collection This retrospective cohort study analyzed patients consecutively referred to Shahid Beheshti and Besat Hospitals in Hamadan Province, Iran, whose medical records were reviewed for the period August 2023 to November 2024. The study included people aged 25 years or older diagnosed with T2DM as per 2023 ADA guidelines (e.g., HbA1c ≥ 6.5%, FPG ≥ 126 mg/dL, or taking anti‐diabetic drugs). Variable Definition and Preprocessing A total of 15 clinical and demographic variables were analyzed as potential risk factors for diabetic complications. These features were categorized as follows: Categorical variables were defined and encoded as binary (Yes/No), unless otherwise specified. Sex was documented as male or female. Smoking status indicated a history of current or past tobacco use. Addiction to other drugs was operationalized as a binary clinical variable derived from medical records, indicating documented use or dependence on substances with known misuse potential—including opium and alcohol—as recorded by the treating physician during routine clinical assessment. A family history of diabetes was recorded for diagnoses in first‐degree relatives. The type of diabetes treatment was categorized based on the primary pharmacological therapy at the time of data collection into oral pill (e.g., metformin) or injection (e.g., insulin). Continuous variables are reported as mean ± standard deviation (SD) and include the following: Age (years), body mass index (BMI) (kg/m2), duration of diabetes (years), fasting blood sugar (FBS) (mg/dL), blood pressure measurements: diastolic and systolic (mmHg), postprandial plasma glucose (PPG) (mg/dL), lipid profile components: LDL cholesterol, HDL cholesterol, and triglycerides (TG) (mg/dL). The dataset was characterized by a low incidence of missing data, with all variables having less than 5% missing values. To keep the sample size consistent, missing values were filled in. For categorical variables, the mode was used, while the mean was used for continuous variables. The original MLC task included five complication categories: retinopathy, nephropathy, neuropathy, cardiovascular events (CVEs), and cerebrovascular events. Label Aggregation Strategy The original MLC task comprised five complication categories: retinopathy, nephropathy, neuropathy, CVEs, and cerebrovascular events. Preliminary analysis revealed a substantial class imbalance, with certain individual complications (particularly cerebrovascular events) exhibiting a notably low prevalence, which would preclude robust model training. To address this limitation while preserving clinical meaningfulness, we implemented a label aggregation strategy based on the dominant pathophysiological mechanism driving severe outcomes. Microvascular complications were defined as the composite endpoint of retinopathy, nephropathy, or neuropathy, reflecting their shared etiology of capillary basement membrane thickening and endothelial dysfunction in small vessels. Macrovascular complications were defined as a composite endpoint consisting of CVEs and cerebrovascular events [21, 22, 23, 24]. Consequently, the multi‐label prediction framework was ultimately delineated into two aggregated outcome categories: microvascular complications and macrovascular complications. Multi‐Label Classification Framework The MLC problem involves assigning a set of relevant labels to a single instance, as opposed to a single, exclusive class. We employed the problem transformation approach, which converts the multi‐label problem into one or more single‐label problems [25]. Specifically, we evaluated two state‐of‐the‐art strategies: Binary Relevance: This method transforms the multi‐label problem into independent binary classification tasks for each label. A separate classifier is trained to predict the presence or absence of each complication group (microvascular and macrovascular). While computationally efficient and simple, BR inherently assumes label independence and may not capture correlations between complications [26, 27]. Classifier Chains: This method captures label correlations by arranging binary classifiers in a sequence. The first classifier in the chain predicts the first label. Subsequently, the feature space for each following classifier is augmented with the predictions of all previous classifiers in the chain as additional input features [26, 27]. This allows the model to learn dependencies; for example, how the presence of a microvascular complication might influence the risk of a macrovascular one. Label Order To address the order‐sensitivity of CCs, we implemented a clinically informed label sequence. The initial labels comprised microvascular complications (retinopathy, nephropathy, and neuropathy), succeeded by macrovascular complications (cardiovascular, cerebrovascular). This hierarchy is grounded in the typical pathological progression of Type 2 diabetes, wherein microvascular changes frequently precede macrovascular events. Stacked Ensemble Architecture To overcome the limitations of single‐model classifiers and homogeneous ensembles, we implemented a stacking framework. This heterogeneous ensemble leverages multiple, diverse base‐learning algorithms to create a more robust and accurate meta‐model. Our stacking architecture was implemented as follows: Base Learners: We selected three distinct and powerful algorithms to ensure model diversity: RF, LGB, and Cat Boost. The integration of a bagging‐based learner (RF) with two distinct boosting algorithms (LGB, Cat Boost) ensures a high degree of predictive diversity. This provides the meta‐learner with a rich set of uncorrelated meta‐features, enabling it to learn a more powerful and generalizable combination rule than is possible with a single model type. Meta‐Learner: The predictions (class probabilities) of all base learners for both the BR and CC strategies were concatenated to form a new “meta‐feature” matrix. A multi‐output logistic regression model was then trained as the meta‐learner to generate the final predictions for both complication labels simultaneously. This approach allows the meta‐learner to learn the optimal combination of base‐model predictions while respecting the multi‐label nature of our classification task. Hyperparameter Tuning Hyperparameters for all base learners and the logistic regression meta‐learner were optimized using a GridSearchCV within the 5‐fold cross‐validation framework on the training set to prevent overfitting. The final optimized hyperparameter values yielding the best mean cross‐validated F1‐score are reported in Table 1. Table 1Optimized hyperparameters of base learners and meta‐learner used in the stacked ensemble model.MethodsHyperparametersDefinitionValueRandom Forestn_estimatorsNumber of trees constructed in the forest300ntreeThe number of trees5Light GBM (Light Gradient Boosting Machine)num_leaves31learning_rateShrinkage rate applied to each boosting step0.1n_estimatorsNumber of boosting iterations500max depthThe depth of the tree6Cat Boost (Categorical Boosting)iterationsNumber of boosting iterations500depthThe depth of the tree8learning_rateLearning rate controlling tree contribution0.05loss_functionLoglossLogistic Regression (Meta‐Learner)penaltyType of regularization appliedL2CInverse of regularization strength1.0solverOptimization algorithm used for traininglbfgsmax_iterMaximum number of optimization iterations1000John Wiley & Sons, Ltd. Optimized hyperparameters of base learners and meta‐learner used in the stacked ensemble model. Handling Class Imbalance To mitigate the effects of the class imbalance observed in our dataset (microvascular: 55.4%, macrovascular: 38.0%), we employed a class‐weighted learning approach across all models. Class weights were automatically calculated inversely proportional to class frequencies in the training data, increasing the cost of misclassifying minority class instances. This strategy was consistently applied to all base learners (RF, LGB, and Cat Boost) and the meta‐learner, ensuring balanced attention to all complication categories during optimization without altering the original data distribution through resampling. Model Implementation and Evaluation All models were implemented in Python using the Scikit‐learn and Scikit‐multilearn libraries. The performance of the proposed stacked ensemble was benchmarked against each individual base learner (RF, LGB, and Cat Boost) applied within the BR and CC frameworks. The model training utilized a 5‐fold cross‐validation scheme to prevent data leakage and ensure generalizability. The base models were trained on the training folds, and their out‑of‑fold predictions on the validation folds were used to train the meta‑learner. Model performance was evaluated using established multi‐label metrics, including Hamming Loss, precision, recall, area under the curve (AUC), and the F1‐score. Interpretability and Risk Factor Analysis To ensure clinical actionability and meet the second aim of this study, we performed a post hoc interpretability analysis to identify, rank, and interpret the key risk factors associated with each complication group. This was achieved using SHapley Additive exPlanations (SHAP), a unified approach based on cooperative game theory that quantifies the marginal contribution of each feature to a model′s prediction [28]. SHAP analysis was applied to the final stacked ensemble model and its constituent base learners. This facilitated both global interpretation, identifying the most important risk factors across the entire population by calculating mean absolute SHAP values, and local interpretation, elucidating the drivers of risk for individual predictions. All SHAP analyses were implemented in Python using the shap library. For the tree‐based base learners (RF, LGB, and Cat Boost), the highly efficient TreeExplainer was used to compute exact Shapley values. The analysis was performed exclusively on the held‐out test set to ensure the generalizability of the findings. Global feature importance was summarized using SHAP bar plots, while the direction and nature of feature effects were visualized using summary plots. Results Dataset Characteristics and Label Analysis A cohort of 965 patients was stratified into three groups according to their complication status: those with microvascular complications (n = 535, 55.4%), those with macrovascular complications (n = 367, 38.0%), and a control group with no complications (n = 348, 36.1%). Table 2 summarizes the demographic and clinical characteristics of these groups. Table 2Comparison of patient characteristics by diabetic complication status.VariablesMicrovascular complications Yes = 535 (55.4%)Macrovascular complications Yes = 367 (38%)Non complication Yes = 348 (36.1%)SexMale303 (56.6%)215 (58.6%)159 (45.7%)Female232 (43.4%)152 (41.4%)189 (54.3%)Addiction to other drugsYes74 (13.8%)58 (15.8%)17 (4.9%)No461 (86.2%)309 (84.2%)331 (95.1%)Family history of diabetesYes200 (37.4%)148 (40.3%)67 (19.3%)No335 (62.6%)219 (59.7%)281 (80.7%)Type of treatmentOral pill266 (49.7%)172 (46.9%)226 (64.9%)Injection269 (50.3%)195 (53.1%)122 (35.1%)SmokingYes64 (12.0%)41 (11.2%)34 (9.8%)No471 (88.0%)326 (88.8%)314 (90.2%)Variables Mean ± SD Mean ± SD Mean ± SD Age (years)63.92 ± 13.0764.83 ± 11.3663.85 ± 12.81BMI (body mass index) (kg/m2)27.18 ± 5.3127.54 ± 5.3125.64 ± 4.87Duration of diabetes (years)11.64 ± 6.5312.37 ± 6.887.01 ± 4.67FBS (fasting blood sugar) (mg/dL)227.87 ± 88.01238.84 ± 90.92212.46 ± 85.77Diastolic blood pressure (mmHg)94.29 ± 29.14100.69 ± 33.8790.32 ± 20.94Systolic blood pressure (mmHg)113.53 ± 28.82119.02 ± 30.85105.20 ± 24.84PPG (postprandial plasma glucose) (mg/dL)278.44 ± 88.65289.03 ± 92.22255.58 ± 91.35LDL (low‐density lipoprotein) (mg/dL)67.61 ± 33.5275.07 ± 40.4657.84 ± 24.23HDL (high‐density lipoprotein) (mg/dL)44.29 ± 15.9745.94 ± 16.1740.87 ± 15.28TG (triglycerides) (mg/dL)127.54 ± 62.39127.08 ± 57.29114.71 ± 42.36John Wiley & Sons, Ltd. Comparison of patient characteristics by diabetic complication status. The sex distribution varied, with a higher proportion of males in the complication groups (microvascular: 56.6% male; macrovascular: 58.6% male) compared to the non‐complication group (45.7% male). A family history of diabetes and addiction to other drugs (alcohol, opioids) is approximately twice as prevalent in the complication groups (e.g., family history: microvascular 37.4%, macrovascular 40.3%) compared to the non‐complication group (19.3%) (Tables 2). Patients with complications had a markedly longer duration of diabetes (microvascular: 11.6 ± 6.5 years; macrovascular: 12.4 ± 6.9 years) than those without complications (7.0 ± 4.7 years). Accordingly, treatment patterns differed, with over half of the patients in the complication groups relying on insulin injections (microvascular: 50.3%; macrovascular: 53.1%), whereas the majority in the non‐complication group were managed with oral pills (64.9%). Metabolic control was generally poorer in the complication groups. This was reflected in higher mean levels of FBS, PPG, and systolic blood pressure, with the macrovascular group showing the highest values (e.g., systolic BP: 119.0 ± 30.9 mmHg). Lipid profiles also differed, with lower LDL and higher HDL levels observed in the non‐complication group. Furthermore, patients with complications had a higher average BMI (27.2–27.5 kg/m2) compared to those without complications (25.6 ± 4.9 kg/m2). Analysis of label relationships revealed a moderate positive correlation (r = 0.35) between the two complication types. Conditional probability analysis demonstrated a strong asymmetric interdependence: Among patients with macrovascular complications, 77.7% (n = 285) also had microvascular complications, suggesting that macrovascular disease seldom presents in isolation from microvascular processes. Conversely, 53.3% of patients with microvascular complications developed macrovascular complications, indicating that microvascular damage significantly elevates the risk of macrovascular involvement. Analysis revealed four distinct patient phenotypes based on complication co‐occurrence: a low‐risk group with no complications (36.1%), a high‐risk group with both complications (29.5%), and two intermediate groups with either isolated microvascular (25.9%) or isolated macrovascular (8.5%) complications, justifying the multi‐label approach (Table 2). Comparative Model Performance A comprehensive evaluation of multi‐label learning strategies demonstrated the consistent superiority of the stacked ensemble approach. The Stacking‐CC model achieved the best overall performance, attaining the lowest Hamming Loss (0.2313 ± 0.0180) and the highest scores in precision (0.7845 ± 0.0459), F1‐score (0.7519 ± 0.0488), and AUC (0.8572 ± 0.0320). This represents a 3%–5% absolute improvement in F1‐score and a 2%–3% improvement in AUC over the best‐performing single‐model baselines (CC‐LGB and BR‐RF) (Table 3). Table 3Comparative overall performance of multi‐label learning methods.IndexHamming lossPrecisionRecallF1‐scoreAUCBR_RF0.2408 ± 0.02480.7422 ± 0.05740.7214 ± 0.07910.7209 ± 0.04690.8346 ± 0.0310BR_LGB0.2539 ± 0.03430.7339 ± 0.02230.7136 ± 0.08040.7238 ± 0.04510.8302 ± 0.0359BR_CAT0.2600 ± 0.0470.7324 ± 0.03160.7028 ± 0.03810.7189 ± 0.02110.8338 ± 0.0324CC_RF0.2418 ± 0.04510.7637 ± 0.06020.7290 ± 0.12410.7334 ± 0.05010.8309 ± 0.0426CC_LGB0.2570 ± 0.03870.7225 ± 0.06820.7260 ± 0.05790.7372 ± 0.02550.8352 ± 0.0232CC_CAT0.2507 ± 0.06750.7405 ± 0.05560.7213 ± 0.06950.7206 ± 0.04670.8315 ± 0.0386LP_RF0.2492 ± 0.04330.7548 ± 0.06250.6952 ± 0.10110.7223 ± 0.04920.8311 ± 0.0394Stacking BR0.2405 ± 0.02080.7604 ± 0.06410.7261 ± 0.09840.7395 ± 0.04770.8468 ± 0.0304Stacking‐CC0.2313 ± 0.01800.7845 ± 0.04590.7430 ± 0.11100.7519 ± 0.04880.8572 ± 0.0320Abbreviations: AUC, area under the ROC curve; BR, Binary Relevance; CAT, Categorical Boosting; CC, Classifier Chain; LGB: Light Gradient Boosting Machine; LP, Label Power Set; RF, Random Forest.John Wiley & Sons, Ltd. Comparative overall performance of multi‐label learning methods. Abbreviations: AUC, area under the ROC curve; BR, Binary Relevance; CAT, Categorical Boosting; CC, Classifier Chain; LGB: Light Gradient Boosting Machine; LP, Label Power Set; RF, Random Forest. Complication‐Specific Performance Microvascular Complications: The Stacking‐CC and CC‐RF models achieved the highest recall (0.7910 ± 0.1459 and 0.7916 ± 0.1258, respectively), demonstrating superior sensitivity. Stacking‐CC also yielded the highest AUC (0.8182 ± 0.0642), confirming its robust discriminative ability (Table 4). Table 4Comparison of multi‐label classification methods for microvascular complication.IndexHamming lossPrecisionRecallF1‐scoreAUCBR_RF0.2920 ± 0.05940.7353 ± 0.11830.7633 ± 0.15090.7586 ± 0.05990.7812 ± 0.0620BR_LGB0.2900 ± 0.06840.7421 ± 0.11120.7393 ± 0.11360.7394 ± 0.07720.7828 ± 0.0648BR_CAT0.2912 ± 0.08600.7496 ± 0.06380.7132 ± 0.08490.7306 ± 0.06120.7945 ± 0.0499CC_RF0.2860 ± 0.05340.7403 ± 0.11830.7916 ± 0.12580.7616 ± 0.05990.7912 ± 0.0620CC_LGB0.2870 ± 0.06840.7421 ± 0.11120.7423 ± 0.11360.7424 ± 0.07720.7938 ± 0.0648CC_CAT0.2912 ± 0.08600.7465 ± 0.12800.7132 ± 0.08490.7306 ± 0.06120.7945 ± 0.0499LP_RF0.2870 ± 0.05270.7523 ± 0.10420.7245 ± 0.14580.7357 ± 0.04630.7840 ± 0.0515Stacking BR0.2767 ± 0.06840.7540 ± 0.13030.7876 ± 0.12580.7455 ± 0.06080.7928 ± 0.0617Stacking‐CC0.2767 ± 0.06840.7616 ± 0.06380.7910 ± 0.14590.7636 ± 0.05670.8182 ± 0.0642Abbreviations: AUC, area under the ROC curve; BR, Binary Relevance; CAT, Categorical Boosting; CC, Classifier Chain; LGB, Light Gradient Boosting Machine; LP, Label Power Set; RF, Random Forest.John Wiley & Sons, Ltd. Comparison of multi‐label classification methods for microvascular complication. Abbreviations: AUC, area under the ROC curve; BR, Binary Relevance; CAT, Categorical Boosting; CC, Classifier Chain; LGB, Light Gradient Boosting Machine; LP, Label Power Set; RF, Random Forest. Macrovascular Complications: For this outcome, Stacking‐CC achieved the highest precision (0.7746 ± 0.0525), F1‐score (0.7943 ± 0.0966), and AUC (0.8725 ± 0.0563) (Table 5). Table 5Comparison of multi‐label classification methods for macrovascular complication.IndexHamming lossPrecisionRecallF1‐scoreAUCBR_RF0.2109 ± 0.06690.7091 ± 0.04470.6283 ± 0.19250.7059 ± 0.13440.8513 ± 0.0730BR_LGB0.2207 ± 0.06010.7258 ± 0.10360.6776 ± 0.19050.6986 ± 0.10540.8382 ± 0.0713BR_CAT0.2228 ± 0.03400.7153 ± 0.05240.6882 ± 0.15070.7001 ± 0.08200.8385 ± 0.0634CC_RF0.2269 ± 0.04590.7121 ± 0.06140.6801 ± 0.19190.6934 ± 0.09220.8415 ± 0.0945CC_LGB0.2269 ± 0.05850.7029 ± 0.09470.7072 ± 0.15670.7028 ± 0.06940.8432 ± 0.0521CC_CAT0.2321 ± 0.07360.6833 ± 0.11090.7348 ± 0.18970.7057 ± 0.09210.8601 ± 0.0815LP_RF0.2114 ± 0.06260.7573 ± 0.08980.6552 ± 0.17660.7006 ± 0.10950.8499 ± 0.0614Stacking BR0.2102 ± 0.03230.7468 ± 0.05720.7013 ± 0.17300.7438 ± 0.09440.8505 ± 0.0547Stacking‐CC0.2145 ± 0.03100.7746 ± 0.05250.7327 ± 0.17670.7943 ± 0.09660.8725 ± 0.0563Abbreviations: AUC, area under the ROC curve; BR, Binary Relevance; CAT, Categorical Boosting; CC, Classifier Chain; LGB, Light Gradient Boosting Machine; LP, Label Power Set; RF, Random Forest.John Wiley & Sons, Ltd. Comparison of multi‐label classification methods for macrovascular complication. Abbreviations: AUC, area under the ROC curve; BR, Binary Relevance; CAT, Categorical Boosting; CC, Classifier Chain; LGB, Light Gradient Boosting Machine; LP, Label Power Set; RF, Random Forest. Interpretation of Risk Factors via SHAP Analysis Overall Feature Importance The overall feature importance (Figure 1), which stands for the combined predictive power of features across all target classes, was most significantly influenced by “Addiction to other drugs” (0.779) feature. After that, there were the important clinical biomarkers, such as HDL (0.749), diastolic BP (0.703), FBS (0.682), and type of diabetes treatment (0.675), in a close order. The traditional risk factors like smoking (0.129), sex (0.074), BMI (0.035), and age (0.000) revealed very low importance in the overall model of the comparison. The observed pattern indicates that, in our cohort, metabolic control and certain behavioral factors are leading, edge factors that directly predict the complication status, whereas demographic and commonly known lifestyle variables have a lesser effect (Figure 1). Feature importance for predicting multiple diabetes complications based on Stacking‐Classifier Chain model. Complication‐Specific Feature Importance Macrovascular Complications: The model gave lipid profile (LDL: 0.907) components the most weight or influence. Diastolic BP (0.876) and FBS (0.796) came subsequently. The firm focus on LDL and the involvement of total cholesterol (TC, 0.427) are in perfect agreement with the already known medical facts, which point out that dyslipidemia is the main cause of atherosclerosis and large, vessel disease. Microvascular Complications: The set of features that determine the risk of microvascular disease is quite different from those for macrovascular disease. Besides that glycemic control still being very important (FBS, 0.796), addiction to other drugs (0.630) was identified as a significantly influential factor; thus, it was higher than HDL (0.585) and systolic BP (0.544). The difference in the relative importance of lipids (LDL, TC) between the microvascular and macrovascular models that goes in the direction of the lipid focus of the macro‐model is in agreement with the difference in the pathological focuses of each disease (Figure 2). Feature importance for predicting microvascular and macrovascular diabetes complications based on Stacking‐Classifier Chain model. Discussion A heterogeneous stacked ensemble model that integrates RF, LGB, and Cat Boost within the CCs framework was created and tested to predict microvascular and macrovascular complications in Type 2 diabetes. The Stacking‐CC model achieved better predictive performance with clinically interpretable risk factor profiles, thus overcoming two major limitations in clinical prognostication: the inability to handle co‐occurring conditions and the lack of model transparency. The Stacking‐CC model demonstrated strong predictive performance (AUC: 0.85, overall) and offered both statistical and clinical advantages; for example, it has high specificity (0.79) that reduces the number of false alarms and patient anxiety, as well as unnecessary tests and costs. The CC technique was effective as it appropriately represents the medical knowledge that the side effects of diabetes are interdependent. This was confirmed by the research data, indicating a moderate correlation between the particular complications. Such a model, which mirrors the actual biological network, is more trustworthy and has more value in clinical practice than the models that separately predict each complication. The Stacking‐CC model was able to go beyond the limitations of standard multi‐label methods. It outperformed the BR method since it reflected how complications affect each other, and it was better than a regular CC by employing a diverse set of models to generate a more robust and accurate final prediction. This suggests that a stacking multi‐label model is necessary for successful multi‐label prediction of complex diseases such as diabetes [11]. The SHAP analysis opened the model′s decisions to understanding; thus, the model was no longer a “black box” but rather a “glass box.” This openness gave impetus to the already existing medical knowledge and also provided additional insights that were supported by the observed data in a very convincing way. SHAP values quantify the marginal contribution of each feature to the model's predictive output under the observed data distribution and should therefore be interpreted as indicators of association and predictive relevance, not as evidence of direct causality. Consequently, all identified risk factors represent markers of increased complication risk within this cohort, potentially reflecting underlying clinical, behavioral, or healthcare‐related mechanisms [28]. The major outcome of this research is that a stacked multi‐label model is able to produce feature importance profiles that are not only clinically plausible but also different for various complications. This substantiates the capability of the model to identify the different unique pathophysiological pathways, like the dominance of lipids in macrovascular disease versus the importance of behavioral factors in microvascular disease that define the diabetic complication landscape. One unique behavioral factor, addiction to other drugs, was singled out as a major predictor, especially for microvascular complications, thus indicating the strong influence of socioeconomic and behavioral determinants in these kinds of diseases. On the other hand, LDL cholesterol was confirmed as the main factor leading to macrovascular complications; hence, the model's clinical relevance in terms of the lipid‐related disease mechanisms was verified. Traditional metabolic markers, like FBS and HDL, taken at one point in time may not fully show the total impact of blood sugar levels on these patients. At the same time, substance use can act as a constant sign of high risk. Diastolic blood pressure and FBS are key risk factors, suggesting their basic part in both microvascular and macrovascular diabetic issues. It is worth noting that common traits like age and BMI were not as telling, so current metabolic control matters more in diabetic people. The main message from this research is the need for individualized risk profiling of diabetic complications, whereby behavioral health intervention is emphasized as an indispensable factor in microvascular disease prevention and lipid management in macrovascular disease control [11, 29, 30]. The identification by this research of substance use as the major risk factor for microvascular complications is strongly supported by the literature. The clinical evidence provided by Winhusen et al. shows that the occurrence of neuropathy and renal disease in diabetes is greatly elevated in patients with substance use disorders. In addition, the biological plausibility of this association is well explained by the research, such as Karam et al., which reveals that opium addiction interferes with essential metabolic processes, thereby producing a physiological condition that promotes microvascular damage. Therefore, our study goes beyond viewing substance use merely as a comorbidity and instead recognizes it as the main predictor of the progression of diabetic microvascular complications [31, 32]. However, the dominant effect likely operates through critical behavioral and self‐care pathways. Substance use disorder is strongly associated with poor medication adherence, erratic dietary patterns, missed clinical appointments, and an overall reduced capacity for the demanding self‐management required for diabetes. Consequently, patients with this risk factor are far more likely to experience sustained hyperglycemia, the fundamental predictor of microvascular complications. In this context, our model may be identifying “addiction to other drugs” as the most robust proxy for uncontrolled diabetes and inconsistent care within our cohort. The traditional metabolic markers (e.g., FBS, HDL) captured in a single snapshot are likely insufficient to represent the cumulative glycemic burden in these patients, whereas the substance use variable serves as a persistent flag for this high‐risk phenotype [33, 34, 35]. Furthermore, because substance use was recorded as a composite binary variable based on clinical documentation, we were unable to assess dose, duration, or specific effects of substances, which limits mechanistic interpretation. The SHAP analysis revealed an unexpectedly low independent contribution of patient age to the model's predictions. We posit three nonexclusive explanations for this finding: first, a degree of collinearity with diabetes duration, which may more directly capture disease chronicity; second, the relatively narrow age distribution within our cohort of adults with established Type 2 diabetes, limiting its discriminative power; and third, the model's emphasis on stronger, short‐term predictors such as current glycemic control and behavioral parameters. We divided complications into microvascular and macrovascular groups. This was not just for organization; it addressed class imbalance and maintained a focus on key disease processes. Of course, this method loses some specificity. For instance, the model cannot easily distinguish between retinopathy and nephropathy. However, that trade‐off actually clarifies the clinical objective: to identify patients who are generally at greater risk. With this approach, primary care physicians can target patients who require closer monitoring and potentially more intensive treatment. Looking forward, future research could expand on this framework to envision a system where a general screening model first highlights high‐risk patients, followed by more specialized models that predict which specific complications those patients might develop. Though it showed promising outcomes, the study is limited in several aspects that need to be taken into account. Initially, the single‐center, retrospective design, which heavily depends on data from a regional healthcare system in Iran, raises the possibility of selection bias, as the cohort probably represents patients with advanced disease who have been referred for specialized care over other patients. Moreover, this design is also naturally vulnerable to information bias resulting from missing data or inaccuracies in the coding of electronic health records. Employing single imputation (e.g., mean/mode substitution) constitutes a methodological limitation, given its potential to introduce bias and affect variance estimates within tree‐based models, even with minimal (< 5%) missing data. This approach was selected to prioritize analytical simplicity and computational efficiency. The adoption of more sophisticated techniques, while methodologically preferable, was precluded by the practical constraints of the present study. Besides, our analysis was missing key confounders that were not measured but are known to have a significant impact on the risk of complications, including longitudinal HbA1c, detailed medication history, and socioeconomic indicators. Their absence limits mechanistic interpretation and may contribute to residual confounding. Therefore, the model is best applied as a risk stratification tool, not as a causal explanation for disease progression. Furthermore, the absence of detailed data on adherence and socioeconomic factors, combined with the strong predictive signal from “addiction to other drugs,” suggests this variable operates largely as a proxy for these unmeasured behavioral and care‐related risks. Therefore, subsequent investigations need to emphasize a prospective, multi‐center confirmation to compare actual, world results. Subsequent iterations of the model may be enhanced by adding additional biomarkers or genetic data to elevate its predictive power. The core objective involves translating this strategy to a clinical decision support system that is seamlessly interfaced with the electronic health record, thereby permitting instantaneous risk evaluation at the point of care. Conclusion In conclusion, the stacked ensemble multi‐label learning model performs well with high interpretability to jointly predict complicated occurrences of diabetic complications. This model can serve as an efficient basis for more proactive management of the rapidly increasing number of diabetic patients worldwide because it measures the differential contribution of risk factors and confirms existing assumptions with evidence‐based facts. Author Contributions Maryam Farhadian supervised the entire process, including design of the study, performing the literature review, analysis, and initial manuscript drafting. Nasrin Piran and Shiva Borzouei collected the data, while Maryam Zamani assisted in the literature review and analysis. All authors contributed to interpreting results, writing, and finalizing the manuscript. Ethics Statement Authors confirm that all experiments were performed in accordance with relevant guidelines and regulations. The research ethics committee of Hamadan University of Medical Sciences approved the study (IR.UMSHA.REC.1403.654), and informed consent was waived due to the retrospective design, and the data are fully de‐identified, and no intervention on patients was performed. Conflicts of Interest The authors declare no conflicts of interest. Use of Large Language Models, AI, and Machine Learning Tools During the preparation of this manuscript, generative AI (ChatGPT, DeepSeek) was used solely for language refinement and editing suggestions. All scientific content, data analysis, and interpretation were performed by the authors. AI tools did not influence study design, data analysis, or conclusions.