In this study, the risk prediction model of type 2 diabetes was established by Logistic regression, decision tree, BP neural network, support vector machine and deep neural network methods based on the survey data of residents of Dongguan City, Guangdong Province during 2016-2018 and its risk factors. The prediction effect of the model was evaluated based on the accuracy rate, recall rate, AUC value of the area under the curve and other indicators. DeLong test was used to statistically analyze the difference in AUC value of each model, and the prediction results of each model were compared and analyzed. The results showed that, based on the selected data set, the prediction effect of the backpropagation neural network model was the best, the accuracy was as high as 93.7%, the recall rate was 92.8%, and the AUC was 0.977. This study could provide a methodical reference for the prediction of the disease risk of type 2 diabetes.