Objective To explore the influencing factors for the occurrence of type 2 diabetes mellitus (T2DM) based on decision tree and Logistic regression models, so as to provide scientific basis for early screening of high⁃risk population. Methods A total of 3235 individuals with routine check⁃up were selected as the research subjects. The prediction model was established by employing the chi⁃square automatic interaction detector of decision tree and Logistic regression in SPSS 26.0 software . Area under the curve (AUC) of receiver operating characteristic, sensitivity, specificity, and Youden index were compared between the two models. Results A total of 186 patients suffered from T2DM. The results of decision tree model analysis revealed that age, body mass index, triglyceride, systolic blood pressure, concomitant hypertension, and gender were the influencing factors for the occurrence of T2DM. The results of Logistic regression model analysis indicated that gender, age, body mass index, systolic blood pressure, and triglyceride level were the influencing factors for the occurrence of T2DM. The results obtained by the two models were basically the same. AUC of decision tree model for predicting the occurrence risk of T2DM was 0.832, which was larger than that of Logistic regression model (0.800, P<0.05), and the prediction performance of the two models was favorable. The specificity (0.688) and Youden index (0.537) of decision tree model were higher than those of Logistic regression model (0.626, 0.481), and the sensitivity (0.855) of Logistic regression model was higher than that of decision tree model (0.849). Conclusion The models of decision tree and Logistic regression established in this study can favorably predict the occurrence risk of T2DM. In practice, it is recommended to combine the two models to maximize the advantages of the two models and provide reference basis for the further prevention and treatment of T2DM.