The common cause of blindness in people with type 2 diabetes (T2D) is diabetic retinopathy (DR). Early fundus examinations have been shown to prevent vision loss, but routine ophthalmic screenings for patients with diabetes present significant financial and material challenges to existing health-care systems. The purpose of this study is to build a DR prediction model based on the extreme learning machine (ELM) and to compare the performance with the DR prediction models based on support machine vector (SVM), K proximity (KNN), random forest (RF) and artificial neural network (ANN). Methods: From January 1, 2020 to November 31, 2021, data were collected from electronic inpatient medical records at Lu'an Hospital of Anhui Medical University in China. An extreme learning machine (ELM) algorithm was used to develop a prediction model based on demographic data and blood testing and urine test results. Several metrics were used to evaluate the model's performance: (1) classification accuracy (ACC), (2) sensitivity, (3) specificity, (4) Precision,(5) Negative predictive value (NPV), ( 6) Training time and (7) area under the receiver operating characteristic (ROC) curve (AUC). Results: In terms of ACC, Sensitivity, Specificity, Precision, NPV and AUC, DR prediction model based on SVM and ELM is better than DR prediction model based on ANN, KNN and RF. The prediction model for diabetic retinopathy based on elm is the best among them in terms of ACC, Precision, Specificity, Training time and AUC, with 84.45%, 83.93%, 93.16%,1.24s, and 88.34%, respectively. The DR prediction model based on SVM is the best in terms of sensitivity and NPV, which are, respectively, 70.82% and 85.60%. Conclusion: According to the findings of this study, the model based on the extreme learning machine presents an outstanding performance in predicting diabetic retinopathy thus providing technological assistance for screening of diabetic retinopathy.