Fig. 5: Model interpretability and causal inference analysis.

a SHAP summary plot (bee swarm). This plot evaluates the contribution of each feature to the model using mean SHAP values, displayed in descending order, with color indicating feature value (red = high, blue = low). b SHAP interaction heatmap. This plot quantifies pairwise feature interactions, where darker colors represent stronger interaction effects. c Three-dimensional partial dependence plot (3D PDP). This plot visualizes the joint effect of surgery time, GCS and skull defect area on the predicted probability. Color intensity ranging from dark to light represents the predicted probability of postoperative complications, with lighter colors indicating higher risk. d Radar plot of counterfactual explanations. This plot presents two counterfactual scenarios generated by DiCE. e Bar plot of ATE estimates. The plot shows the estimated ATEs for two modifiable surgical variables: N–P drainage and use of titanium mesh as the cranioplasty material. f Violin plot of CATE estimates. The plot presents subgroup-level CATE estimates for N–P drainage and use of titanium mesh as the cranioplasty material, stratified by age and sex. DC-CP interval the time interval (in months) between decompressive craniectomy (DC) and cranioplasty (CP), GCS Glasgow Coma Scale, BI Barthel Index, N-P drainage postoperative placement of subcutaneous negative-pressure drainage tubes, Pre-op V-P preoperative ventriculoperitoneal shunt status, Pre-op preoperative, DiCE Diverse Counterfactual Explanations, ATE average treatment effect, CATE conditional average treatment effect.