Identifying predictors of treatment response to repetitive transcranial magnetic stimulation (rTMS) remain elusive in treatment-resistant depression (TRD). Leveraging electronic medical records (EMR), this retrospective cohort study applied supervised machine learning (ML) to sociodemographic, clinical, and treatment-related data to predict depressive symptom response (>50% reduction on PHQ-9) and remission (PHQ-9 < 5) following rTMS in 232 patients with TRD (mean age: 54.5, 63.4% women) treated at the University of California, San Diego Interventional Psychiatry Program between 2017 and 2023. ML models were internally validated using nested cross-validation and Shapley values were calculated to quantify contributions of each feature to response prediction. The best-fit models proved reasonably accurate at discriminating treatment responders (Area under the curve (AUC): 0.689 [0.638, 0.740], p < 0.01) and remitters (AUC 0.745 [0.692, 0.797], p < 0.01), though only the response model was well-calibrated. Both models were associated with significant net benefits, indicating their potential utility for clinical decision-making. Shapley values revealed that patients with comorbid anxiety, obesity, concurrent psychiatric medication use, and more chronic TRD were less likely to respond or remit following rTMS. Patients with trauma and former tobacco users were more likely to respond. Furthermore, delivery of intermittent theta burst stimulation and more rTMS sessions were associated with superior outcomes. These findings highlight the potential of ML-guided techniques to guide clinical decision-making for rTMS treatment in patients with TRD to optimize therapeutic outcomes.