Abstract
Objectives
To develop a machine learning (ML)-based prognostic model for predicting the risk of lower extremity deep vein thrombosis (DVT) after acute stroke, with an emphasis on limb functional assessments.
Methods
We conducted a retrospective analysis of 225 acute stroke patients admitted within 15 days of onset between December 1, 2015, and April 30, 2025. Predictor variables were selected using collinearity diagnostics and Least Absolute Shrinkage and Selection Operator (LASSO) regression. Three machine learning survival models—Gradient Boosting Machine (GBM), Random Survival Forest (RSF), and Generalized Linear Model (GLM)—were employed to identify the most effective model. The performance of the optimal ML model was compared with that of the traditional Cox proportional hazards model using the concordance index (C-index), cumulative/dynamic area under the curve (C/D AUC), and integrated Brier score (IBS). The optimal model was further interpreted using SurvSHAP(t).
Results
Six variables were selected for the model: age, stroke type, gender, tension of the muscle, Brunnstrom stage (lower limb), and sitting balance. The RSF model, implemented using the Ranger algorithm, demonstrated superior performance, with an integrated Brier score (IBS) of 0.081 and a C-index of 0.841. Age and Brunnstrom stage (lower limb) were identified as the most influential predictors.
Conclusion
We developed an ML-based prognostic model for predicting the risk of lower limb DVT after acute stroke. Age and Brunnstrom stage (lower limb) were the most significant predictors. This model shows promise for risk stratification in clinical practice.
Introduction
Stroke is a leading cause of acquired disability worldwide, with substantial consequences for individuals and society. 1 Deep Venous Thrombosis (DVT) is a common and potentially deadly blood clot that typically affects the veins in the lower limbs. It starts in the calf veins and can block venous return.2,3 Current guidelines for preventing DVT after stroke lack specific measures targeting early rehabilitation, despite evidence supporting the crucial role of early activity and rehabilitation in risk reduction.4-6 Moreover, there is limited evidence on how to tailor activity levels to different functional stages or how to incorporate rehabilitation assessments to predict post-stroke DVT.
The selection of predictive variables is crucial for developing a risk assessment model. Factors such as advanced age, female sex, diabetes mellitus, hypertension have been linked to post-stroke DVT.7-13 Additionally, laboratory indicators including elevated D-dimer, elevated C-reactive protein, and homocysteine serve as significant biochemical predictors.9-11,13-15 Low activity levels raise DVT risk. 16 Gait function and the Brunnstrom stage are connected in post-stroke patients, impacting walking ability.17-19 The Barthel Index(BI) evaluates activities of daily living(ADL) performance with 10 items. Multiple studies have shown a correlation between a low total BI score and the occurrence of DVT.13,20-23 However, the effect of Brunnstrom stage and BI on DVT after stroke has not been reported.
Machine Learning (ML) is a prominent methodology utilized within the realm of data mining.24,25 ML techniques play a crucial role in the transformation of extensive data sets, thereby enhancing decision-making processes, increasing efficacy and efficiency, and mitigating human error and costs. 26 Particularly within the healthcare sector, ML methods present novel prospects for the precise evaluation of DVT based on clinical medical records, surpassing conventional statistical approaches. However, there is a scarcity of prognostic models utilizing ML algorithms to forecast DVT occurrence post-stroke.
Rehabilitation plays a crucial role in restoring functional impairments, enhancing the quality of life for patients, and expediting their reintegration into their familial and societal environments. DVT poses a significant obstacle to the rehabilitation process, resulting in elevated healthcare expenditures, underscoring the importance of timely detection and prevention. The objective of this study is to employ ML techniques to develop a predictive model for the risk assessment of post-stroke DVT across varying levels of patient functionality, thereby empowering healthcare providers to make more informed prognoses for individuals at risk of post-stroke DVT.
Material and Methods
Ethical Approval and Patient Selection
This study conforms to the TRIPOD statement and was approved by the Ethics Committee of the First Affiliated Hospital of Nanjing Medical University in accordance with the principles of the Declaration of Helsinki (Ethics No. [ 2022-SR-479 ]). Since all the data were de-identified, the informed consent was waived. Inclusion criteria: Stroke confirmed by CT or MRI, age 18-85, within 15 days of onset, and complete medical records. Exclusion criteria:severe systemic diseases—including but not limited to end-stage renal disease requiring dialysis, decompensated liver cirrhosis, and severe chronic obstructive pulmonary disease; prior history of DVT or vena cava filter placement; pre-admission use of anticoagulant or antiplatelet agents; chronic vascular diseases—including arterial and venous lesions such as varicose veins, peripheral artery occlusive disease, and venous ulcers; and incomplete medical records.
Data Collection for Predictor Variables
A retrospective review was carried out to identify all patients with acute stroke who were admitted to the Rehabilitation Medical Center between December 1, 2015, and April 30, 2025. Demographic characteristics, including age, gender, subtype, and location of stroke, history of hypertension, diabetes mellitus, smoking history, alcohol use history, and previous stroke history, were systematically documented for each patient within 24 hours of admission. Furthermore, data about rehabilitation functional assessment parameters, such as Brunnstrom stage (comprising hand, arm, and lower limb), calf muscle tone(Ashworth Scale), the Barthel Index (total score and sub-items: feeding, transfers, mobility, stairs), and sitting and standing balance, were also recorded within 24 hours of admission. Information regarding DVT prevention measures, encompassing anticoagulant and antiplatelet medication therapy strategies, was also collected. The primary anticoagulant used for VTE prophylaxis was low molecular weight heparin, administered at standard prophylactic doses. All antithrombotic medications were initiated after admission in line with clinical guidelines.
The Endpoint Event
The outcome variables were defined as time to thrombosis and thrombosis status. The study’s endpoint was defined as the occurrence of lower extremity DVT within 15 days after the onset date. Diagnostic criteria for lower extremity DVT included the presence of thrombus echoes in the lumen on two-dimensional ultrasonography, characterized by either uniform low echoes or heterogeneous enhanced. 27
Predictive Variables Screening
To identify predictors, a combination of collinearity diagnosis and the least absolute shrinkage and selection operator (LASSO) regression techniques was employed. Collinearity diagnosis involved assessing the variance inflation factor (VIF), with any variable exhibiting a VIF exceeding 10 being excluded. 28 Subsequently, the remaining variables were deemed as potential predictors and underwent LASSO regression analysis. 29
Construction, Evaluation, and Explanation of Predictive Models
We constructed prediction models using three machine learning survival algorithms—Gradient Boosting Machine (GBM), Random Survival Forest (RSF), and Generalized Linear Model (GLM)—for comparative analysis. Then, the best ML model was compared with the classical Cox Proportional Hazards (Cox) model to filter out the optimal algorithm model. The predictive performance of the model was evaluated using a range of metrics, including accuracy, precision, sensitivity, specificity, F1 score, kappa, consistency index (C index), cumulative/dynamic AUC index (C/D AUC), and integrated Brier score (IBS). SurvSHAP(t) was developed for global and local interpretation of the model. SHAP uses the Shapley value from game theory to distribute predictions fairly among features. 30 It calculates each feature’s contribution to a prediction and quantifies its impact on the model’s prediction.31,32 SurvSHAP(t) extends this method to interpret time-dependent black-box models. 33
Statistical Analysis
The random forest method was used to impute missing values. 34 Normality tests were performed on the dataset, with continuous variables reported as mean ± standard deviation or median (interquartile range [IQR]) and categorical variables presented as frequency (percentage). One-way ANOVA and the Kruskal-Wallis test were utilized for comparisons of normally and non-normally distributed continuous variables, respectively, while Pearson’s chi-square test was employed for comparing categorical variables. Model accuracy assessment and hyperparameter optimization were conducted using a 10-fold cross-validation technique during the training process. Statistics R software (version 4.2.2, https://www.r-project.org/) was used for statistical analyses, and P < .05 was considered statistically significant.
Results
Baseline Data Comparison
Comparison of Demographic and Clinical Characteristics Between Patients With and Without DVT
Screening of Prognostic Factors
All 22 independent risk factors after collinearity diagnosis treatment were included in the LASSO regression analysis. Six characteristics were selected based on the non-zero coefficient calculated from the LASSO regression analysis. These selected features included age, stroke type, gender, tension of the muscle, Brunnstrom stage (lower limb), and sitting balance. These features were then incorporated into the ML algorithm model for further analysis.
Comprehensive Analysis of ML Algorithms
Performance of the GBM, RSF, GLM Model
Comparison of the RSF and Cox Model
Evaluation of three survival models (ranger, rfsrc, coxph) for DVT risk prediction demonstrated consistent superiority of machine learning methods over traditional approaches(Figures 1A and B). The random survival forest (ranger) model achieved optimal performance with the highest discrimination capacity (C-index 0.841; C/D AUC 0.590) and best predictive accuracy (Brier score 0.081). The conditional inference survival forest (rfsrc) performed comparably well, while the Cox proportional hazards model (coxph) showed substantially inferior results across all metrics (C-index 0.676; Brier score 0.107). Performance hierarchy was established as: ranger ≥ rfsrc > coxph, supporting the preference for the Ranger algorithm in DVT risk stratification. Model performance created for the Rfsrc, Ranger, and Cox models. The line chart (A) and bar chart (B) display the evaluation metrics of the models over time. The Ranger model outperforms the others in terms of the IBS scoring metric (lower is better), C/D AUC metric (higher is better), and concordance index
Features Importance for the RSF and Cox Model
Figure 2 shows the results of the three ML algorithms for ranking the features of the models by the mean C index. The top three variables in the Cox model were Brunnstrom stage (lower limb), sitting balance, and tension of the muscle. The top three variables based on the Ranger algorithm(Ranger model) and the RandomForestSRC algorithm(Rfsrc model) were age, Brunnstrom stage (lower limb), and sitting balance. Feature Importance of the Rfsrc, Ranger, and Cox model. X: One minus C−Index loss after permutations. Y: ML Models and Variable Names
Explanations of the Ranger Model
Global Feature Importance and Dependence for DVT Risk Prediction
The integration of time-dependent variable importance analysis and partial dependence analysis provides comprehensive insights into the factors predicting DVT risk in stroke patients.
Time−dependent feature importance plot. X: Time; Y: Brier score loss after permutations with loss of full model subtracted. 
Partial survival dependence plot. It is an overall interpretation of the most important features, which shows the marginal effect of multiple features on the predictions of the machine learning algorithm model. This plot offered a comprehensive interpretation of the most significant predictive features, showcasing the marginal effects of these features on the predicted outcomes of the Ranger algorithm
Discussion
This study developed and validated an ML-based prognostic model for predicting lower limb DVT risk after acute stroke, incorporating early functional rehabilitation assessments. Through retrospective analysis, we found that the RSF model, particularly its implementation based on the Ranger algorithm, demonstrated superior overall discriminatory ability (C-index: 0.841) and predictive accuracy (IBS: 0.081) in predicting DVT risk, significantly outperforming the traditional Cox proportional hazards model (C-index: 0.676; IBS: 0.107). Age and lower limb Brunnstrom stage were identified as the most important predictors.
Nevertheless, the six predictive variables identified through LASSO regression and multicollinearity diagnostics—age, stroke type, gender, tension of muscle, Brunnstrom stage (lower limb), and sitting balance—have clear clinical relevance. From a rehabilitation perspective, the innovation of this study lies in systematically incorporating functional assessment indicators into predictive models, highlighting the unique value of rehabilitation evaluation in the early identification of patients at high risk for DVT.
Time-dependent variable importance analysis showed that age was the most important predictor throughout the 15-day observation period. Studies have shown a strong link between advanced age and DVT, with our research confirming that age was a significant factor in DVT development in acute stroke patients.7,9,35,36 Aging causes blood to become more prone to clotting, increasing the risk of DVT. 37
The Brunnstrom stage (lower limb) was identified as the second most important predictor, with its predictive value further increasing during the later observation period (days 10-15). This indicates that the severity of lower limb motor dysfunction is closely related to DVT risk - worse motor function leads to more severe venous stasis and higher thrombosis risk. This highlights the importance of early rehabilitation interventions, particularly those targeting lower limb motor recovery. 38 Partial dependence analysis showed that higher Brunnstrom stages were associated with significantly improved survival probability, confirming the protective effect of motor function recovery in preventing DVT. The Brunnstrom stages, as a classic assessment tool for post-stroke motor recovery, demonstrate a strong association with DVT risk, suggesting that rehabilitation assessment holds prospective value in thrombosis prevention.
Sitting balance ability was the third most important predictor. Although standing balance showed stronger discriminative power in univariate analysis (p<0.01), sitting balance maintained predictive value in the multivariate model. This may be because sitting balance better reflects the early mobility potential and trunk control ability of patients in the acute phase of stroke, serving as the foundation for whether patients can perform bed activities, transfers, and early sitting training.39,40 Poor sitting balance often indicates that patients require prolonged bed rest, further increasing the risk of DVT. In contrast, standing balance primarily reflects dynamic balance capabilities during the mid-to-late rehabilitation phase, and its discriminatory power within the first 15 days of the acute phase may be limited. Therefore, sitting balance, as an indicator more closely aligned with the actual functional status of acute-phase patients, holds greater clinical predictive utility.
Notably, while gender showed significant differences in univariate analysis, its contribution in the multivariate model was relatively low. This partially aligns with findings by Pan et al, 11 suggesting that gender differences may be confounded by other factors (such as age and activity level) and require further research validation. 41
Stroke type has been confirmed as a predictor of DVT, but its contribution remains relatively limited. Time-dependent analysis indicates that the significance value of stroke type is markedly lower than that of primary indicators such as age and motor function. This relatively weak correlation may stem from indirect mechanisms through which different stroke subtypes influence DVT: patients with hemorrhagic stroke require prolonged immobilization due to the risk of rebleeding, while ischemic stroke patients often present with systemic hypercoagulability. 42 However, these effects are largely masked by confounding factors such as functional status and activity level, diminishing the direct predictive value of stroke type itself.
Tension of muscle shows an inverse relationship with DVT risk, where higher tone correlates with lower risk, though it is less predictive than age or motor function. This may be due to better preservation of neurological function and muscle pump activity, which supports venous return. In contrast, low muscle tone (flaccidity) leads to loss of pump function and increases venous stasis risk.43,44 Although muscle tone has limited predictive value, its clinical relevance suggests that patients with low tone should receive closer monitoring and early interventions, such as muscle activation training and positional management. 44 Further studies should use objective measures to confirm this relationship and refine interventions.
In terms of model comparison, machine learning methods (particularly RSF) significantly outperformed traditional statistical methods, likely due to their ability to better handle complex interaction relationships and nonlinear effects between variables. This finding supports the use of machine learning algorithms in clinical prediction models, especially when dealing with complex data such as rehabilitation function assessment.45,46
Compared to previous studies, the strength of this research lies in the systematic inclusion of rehabilitation function assessment indicators into the prediction model and the use of advanced interpretability methods (such as SurvSHAP(t)) to reveal time-dependent effects of predictors. While Kelly et al. 22 found correlations between the BI and DVT, they did not establish an effective prediction system; the prediction model developed by Liu et al. 47 lacked rehabilitation function indicators. This study fills this gap and provides a practical risk assessment tool for clinical use.
However, a critical finding that warrants in-depth discussion is that despite the model’s high overall discriminatory ability (C-index), its time-dependent discriminatory ability (Cumulative/Dynamic AUC) remains relatively low (approximately 0.590). This phenomenon of high C-index, low time-specific AUC may stem from several causes: First, the most likely reason is the limited sample size in this study, particularly the relatively small number of DVT events (n=65). For complex machine learning models like RSF, a finite number of events may lead to instability in predictions at specific time points, thereby affecting the estimation of time-dependent AUC, even though the model maintains good overall ranking capability. Second, the effect strength of predictive factors may dynamically change over time. For instance, certain factors may be strong predictors in the early post-stroke period but lose influence later. The RSF model captures this complex, nonlinear overall predictive pattern, but its discriminative accuracy fluctuates at each specific time point. This finding also partially reflects the clinical reality of early post-stroke DVT occurrence: within the acute 15-day window, event occurrence may be influenced by numerous unmeasured transient factors. Consequently, while models based on baseline admission indicators can effectively distinguish high-risk from low-risk populations, achieving extremely precise daily-level risk prediction remains challenging.
Limitations
This study has several limitations. First, this was a single-center retrospective study with a limited sample size, especially the small number of DVT events. This likely contributed to the model’s lower time-specific discriminatory accuracy (C/D AUC) and increased the risk of overfitting. Future large-scale, multicenter prospective studies are needed to validate and optimize the model, thereby laying the groundwork for interventional clinical trials. Second, data constraints precluded assessment of established thrombotic biomarkers (notably D-dimer) and pertinent clinical risk factors, including atrial fibrillation and carotid artery plaques, potentially compromising model discrimination. Moreover, the study did not include patients with major established risk factors for venous thromboembolism (e.g., active malignancy, recent surgery or fractures, and oral contraceptive use), resulting in a highly selective study population and precluding assessment of the influence of these factors. In addition, the potential impact of stroke localization (anterior/posterior circulation) on DVT risk was not further analyzed. Future research should incorporate these laboratory and clinical indicators to further enhance the model’s predictive efficacy. Finally, the risk prediction window of this model is limited to within 15 days post-acute stroke; extending follow-up periods would aid in further validating and refining the model’s long-term predictive capabilities.
Conclusion
We successfully developed an ML-based predictive model for acute post-stroke DVT risk incorporating rehabilitation functional assessments. The model demonstrated robust overall predictive performance, with age and lower limb Brunnstrom stage emerging as the primary contributing factors. Although the model exhibits limitations in time-point-specific discrimination, it provides clinicians with a valuable tool for early identification of high-risk patients and the formulation of individualized rehabilitation and prevention strategies. Future work should focus on validating this model in larger prospective cohorts and incorporating laboratory indicators to further enhance its performance.
Footnotes
Acknowledgments
We acknowledge Mr. Chen and his sons for their unconditional support.
Funding
The authors received no financial support for the research, authorship, and/or publication of this article.
Declaration of conflicting interests
The authors declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Data Availability Statement
The participants of this study did not give written consent for their data to be shared publicly, so due to the sensitive nature of the research supporting data is not available.
