ResPredAI is an open-source machine learning pipeline designed to predict antimicrobial resistance (AMR) in Gram-negative bloodstream infections. Built to support clinical decision-making, it implements the methodology described in our research published in npj Digital Medicine.
The framework provides a comprehensive workflow for training, validating, and deploying predictive models, enabling clinicians to anticipate resistance patterns and optimize antimicrobial therapy selection.
Support for 9 algorithms including Random Forest, XGBoost, CatBoost, and TabPFN
Nested cross-validation with group-aware stratification to prevent data leakage
Feature importance analysis using native and SHAP-based methods
Detailed guides, CLI reference, tutorials, and usage examples
A streamlined interface for reproducible model development and validation
respredai run
Execute nested cross-validation with configurable parameters
respredai feature-importance
Extract feature contributions for model interpretability
respredai train
Fit models with automated hyperparameter optimization
respredai evaluate
Assess model performance on external datasets
npj Digital Medicine 8, 319 (2025)
Artificial intelligence (AI) models are promising tools for predicting antimicrobial susceptibility in gram-negative bloodstream infections (GN-BSI). Single-center study on hospitalized patients with GN-BSI, over 7-year period, aimed to predict resistance to fluoroquinolones (FQ-R), third generation cephalosporins (3GC-R), beta-lactam/beta-lactamase inhibitors (BL/BLI-R) and carbapenems (C-R) was performed. Analyses were carried out within a machine learning framework, developed using the scikit-learn Python package. Overall, 2552 patients were included. Enterobacterales accounted for 85.5% of isolates, with E. coli, Klebsiella spp, and Proteus spp being most common. Distribution of resistance was FQ-R 48.6%, 3GC-R 40.1%, BL/BLI-R 29.9%, and C-R 16.9%. Models' validation showed good performance predicting antibiotic resistance for all four resistance classes, with the best performance for C-R (AUC-ROC 0.921 ± 0.013). The developed pipeline has been made available (https://github.com/EttoreRocchi/ResPredAI), along with documentation for running the same workflow on a different dataset, to account for local epidemiology and clinical features.