ObjectiveThis study aimed to develop early mortality risk prediction models for patients with severe acute pancreatitis (SAP) based on eight machine learning algorithms, and to identify the major risk factors. MethodsClinical data of SAP patients diagnosed at West China Hospital of Sichuan University between January 2020 and August 2023, were retrospectively collected and randomly divided into a training set (n=878) and a validation set (n=376) in a 7∶3 ratio. Eight machine learning algorithms, including random forest, logistic regression, support vector machine, multilayer perceptron, XGBoost, Gaussian naive Bayes, CatBoost, and AdaBoost, were applied to construct early mortality prediction models for SAP. The models were evaluated using the area under curve (AUC), decision curve analysis (DCA), and Shapley additive explanations (SHAP). ResultsA total of 1 254 SAP patients were finally included in this study, with an early mortality rate of 15.79% (198/1 254). The random forest algorithm demonstrated the best predictive performance in both the training and validation sets, with AUCs of 0.913 and 0.844, respectively. In the DCA, random forest also yielded the greatest net benefit. SHAP analysis ranked seven key predictors of early mortality in SAP by importance: age, body mass index, heart rate, need for assisted ventilation, hemoglobin, interleukin-6, and lactate dehydrogenase, with the need for assisted ventilation being the most critical predictor. ConclusionThe random forest model developed in this study can assist clinicians in more accurately identifying high-risk SAP patients at an early stage, thereby enabling timely interventions to reduce early mortality.