Preprint
Article

This version is not peer-reviewed.

Counterfactual Digital Twins via Trustworthy and Causality-Aware Machine Learning Approach for Stroke Risk Prediction

Submitted:

10 October 2026

Posted:

12 October 2026

You are already at the latest version

Abstract
Stroke is a leading cause of mortality worldwide, making early and accurate risk prediction aimportant for clinical decision support. This study proposes a trustworthy, causality-aware machine learning framework for stroke risk prediction and digital twin-based counterfactual analysis using the publicly available Kaggle dataset healthcare-dataset-stroke-data.csv, comprising 5,110 patient records with 11 clinical and demographic features. To address class imbalance, the Synthetic Minority Over-sampling Technique (SMOTE) is applied exclusively to the training data. Six machine learning models Random Forest, XGBoost, CatBoost, ExtraTrees, LightGBM and HistGradientBoosting are evaluated using class-wise precision, recall, F1-score, test accuracy and 10-fold cross-validation. XGBoost achieves the highest reported test accuracy of 98.65%, with a stroke-class recall of 100.00% and F1-score of 87.83%, while CatBoost achieves the highest mean cross-validation accuracy of 94.83% ± 0.34%. SHapley Additive exPlanations (SHAP) identify smoking status, gender, work type and residence type as influential predictors, alongside glucose level, age and body mass index. Structural causal models, directed acyclic graphs, the PC algorithm and average treatment effect analysis investigate potential causal relationships among stroke risk factors. Digital twin-based counterfactual simulations examine hypothetical hypertension and glucose-level interventions. In one high-risk case, predicted stroke probability decreases from 99.93% to 65.19% under the reduced-glucose scenario. CatBoost achieves the fastest prediction time of 0.0027 seconds, while XGBoost requires 0.4913 seconds for training and 0.0158 seconds for prediction. These findings demonstrate the potential of integrating machine learning, explainability, causal analysis and counterfactual simulation for individualized stroke risk assessment. Further external validation and clinical evaluation are required before real-world deployment.
Keywords: 
;  ;  ;  ;  ;  ;  ;  ;  ;  ;  
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.