Abstract
BACKGROUND: This study investigates how variations in Major Depressive Disorder (MDD) symptoms (HAM-D) are associated in a predictive model with randomized clinical trial (RCT) arm assignment between SSRIs and SNRIs. METHODS: We applied explainable counterfactual reasoning with counterfactual explanations (CFs) to assess the impact of specific symptom changes on model-predicted RCT arm assignment. RESULTS: Across 17 classifiers, CatBoost achieved the highest performance; typical test metrics ranged 0.74–0.78 with best ROC-AUC 0.7640. Sample-based CFs revealed both local and global feature importance of individual symptoms in medication selection. CONCLUSION: Counterfactual reasoning highlights which MDD symptoms the model uses to distinguish SSRI vs. SNRI trial assignments, supporting interpretable AI-based decision support while requiring prospective real-world validation beyond the RCT context. Future work should validate these findings on more diverse cohorts and refine algorithms for clinical deployment. SUPPLEMENTARY INFORMATION: The online version contains supplementary material available at 10.1186/s12911-026-03403-6.