AbstractBackgroundPatients with end-stage renal disease (ESRD) especially those undergoing dialysis have a high prevalence of hyperkalemia, which must be detected and treated immediately. But the initial symptoms of hyperkalemia are insidious, and traditional laboratory serum potassium concentration testing takes time. Therefore, rapid and real-time measurement of serum potassium is urgently needed. In this study, different machine learning methods were used to make rapid predictions of different degrees of hyperkalemia by analyzing the ECG.MethodsA total of 1024 datasets of ECG and serum potassium concentrations were analyzed from December 2020 to December 2021. The data were scaled into training and test sets. Different machine learning models (LR, SVM, CNN, XGB, Adaboost) were built for dichotomous prediction of hyperkalemia by analyzing 48 features of chest leads V2-V5. The performance of the models was also evaluated and compared using sensitivity, specificity, accuracy, accuracy, F1 score and AUC.ResultsWe constructed different machine models to predict hyperkalemia using LR and four other common machine-learning methods. The AUCs of the different models ranged from 0.740 (0.661, 0.810) to 0.931 (0.912,0.953) when different serum potassium concentrations were used as the diagnostic threshold for hyperkalemia, respectively. As the diagnostic threshold of hyperkalemia was raised, the sensitivity, specificity, accuracy and precision of the model decreased to various degrees. And AUC also performed less well than when predicting mild hyperkalemia.ConclusionNoninvasive and rapid prediction of hyperkalemia can be achieved by analyzing specific waveforms on the ECG by machine learning methods. But overall, XGB had a higher AUC in mild hyperkalemia, but SVM performed better in predicting more severe hyperkalemia.