OBJECTIVE To construct a risk prediction model for hyperkalemia associated with analgesic and sedative drugs during the perioperative period based on the TabPFN model, and to mine key drug risk factors.
METHODS Clinical data of perioperative patients from Wuhan No.1 Hospital were retrospectively collected from July 2022 to November 2025. A total of 524 patients from January 2023 to November 2025 were divided into a training set and an internal validation set at a 3∶1 ratio, while 123 patients from the 2022 July to December served as an external validation set. The study incorporated 67 potential predictors, including baseline characteristics, laboratory tests, and detailed perioperative medication datasuch as nonsteroidal antiinflammatory drugs(NSAIDs), opioids, remimazolam, etc. The TabPFN algorithm, based on the Transformer architecture, was employed for model fitting, with key factor screening conducted via RMSE DROPOUT of the DALEX methods.
RESULTS The TabPFN model demonstrated superior predictive performance in the internal validation set, with an area under the receiver operating characteristic curve of 0.898 and an area under the precision-recall curve of 0.791. The calibration plot indicated a good fit between predicted probabilities and actual risks. Feature importance analysis revealed that, in addition to pathophysiological indicators such as serum creatinine, baseline potassium, and AKI stage, drug-related factors specifically potassium-containing drugs, diuretics, remimazolam tosilate dosage, and NSAIDs which contributed significantly to the risk of hyperkalemia. Notably, the dosage of remimazolam ranked first among anesthesia/sedation-related risk factors.
CONCLUSION This study constructs a TabPFN-based risk prediction model for perioperative hyperkalemia and quantitatively assessed the pathogenic risks of drugs such as remimazolam tosilate and NSAIDs, the model exhibits favorable discrimination and robustness. The research findings can provide clinical pharmacists with a precise quantitative tool for personalized pharmaceutical care in complex perioperative settings.