Urinary tract infections caused by Escherichia coli are among the most common bacterial infections in clinical practice. Increasing antibiotic resistance has made empirical treatment increasingly challenging particularly in resource-limited settings such as Bangladesh. This study proposes an explainable machine learning framework for predicting antibiotic resistance in E. coli UTI patients using routine clinical and laboratory data. Two publicly available datasets were merged to create a
dataset of 10,710 patient records with 32 processed features. Five machine learning models including Logistic Regression, Decision Tree, Random Forest, Support Vector Machine and XGBoost were evaluated using 5-fold stratified cross-validation across five antibiotic resistance targets including Ciprofloxacin, Gentamicin, Amoxicillin-Clavulanic Acid, Cefotaxime/Ceftriaxone and Amoxicillin/Ampicillin. SHAP and LIME were employed to provide global and patient level model explanations. SVM achieved the best overall performance for AMC, CTX/CRO and AMX/AMP with the highest AUC of 0.586 for CTX/CRO, while XGBoost obtained the highest accuracy for CIP (83.87%) and GEN (78.33%) but detected almost no resistant cases at those operating points. SHAP identified age, diabetes status, body temperature, hospital admission history, hypertension and the Neutrophil-to Lymphocyte Ratio as the most influential predictors, consistent with risk factors reported in Bangladeshi clinical studies. These findings demonstrate that explainable machine learning using routinely available clinical data can support early antibiotic resistance prediction and assist empirical antibiotic selection in resource-limited healthcare settings.
