ObjectiveTo explore the predictive value of acute pancreatitis related indicators on its severity, and to establish a prediction model based on machine learning algorithm on the severity of acute pancreatitis. MethodsA retrospective review was conducted of medical records from 262 patients hospitalized for acute pancreatitis at the Second Affiliated Hospital of Zhengzhou University between October 2022 and February 2024. Patients were classified according to the 2012 Atlanta Classification into mild cases (n=146) and non-mild cases (n=116). LASSO analysis was employed to identify predictors for non-mild acute pancreatitis. Six machine learning algorithms Extreme Gradient Boosting, Random Forest, Logistic Regression, Decision Tree, Support Vector Machine, and K-Nearest Neighbors were integrated to construct predictive models. Model performance was evaluated by comparing the following metrics: area under the curve sensitivity, specificity, accuracy, F1 score, calibration curves, and decision curves. ResultsThrough LASSO regression analysis, six feature variables “heart rate, white blood cell count, neutrophil count, C-reactive protein, albumin, and calcium ion” were selected to train and test machine learning models. Results showed that Extreme Gradient Boosting achieved the highest AUC value of 0.93 on the test set, making it the optimal model. The sensitivity, specificity, accuracy, Brier score, and F1 score of the Extreme Gradient Boosting model were 0.97, 0.70, 0.85, 0.108, and 0.84. ConclusionsThe prediction model developed using extreme gradient boosting has high clinical utility value, helps to predict the severity of acute pancreatitis at an early stage and is valuable in guiding clinical decision-making.