Global healthcare centers today are challenged by the dramatic increase in the prevalence of diabetes. Also, complications from diabetes are a major cause of deaths worldwide. One of the most frequent microvascular complications in diabetic patients is diabetic nephropathy (DN) which is the leading cause of death and end-stage renal disease (ESRD). Despite the different risk factors for DN identified in previous research, machine learning (ML) methods can help determine the importance of the predictors and prioritize them. The main focus of this investigation is on predicting the incidence of DN in type 2 diabetic mellitus (T2DM) patients using ML algorithms. Demographic information, laboratory results, and examinations on 6235 patients with T2DM covering a period of 10years (2011-2020) were extracted from the electronic database of the Diabetes Clinic of the Imam Khomeini Hospital Complex (IKHC) in Iran. Recursive feature elimination using the cross-validation (RFECV) technique was then used with the three classification algorithms to select the important risk factors. Next, five ML algorithms were used to construct a predictive model for DN in T2DM patients. Finally, the results of the algorithms were evaluated according to the AUC criteria and the one with the best performance in terms of prediction and classification was selected. The 18 DN risk factors selected by RFECV were age, diabetes duration, BMI, SBP, hypertension, retinopathy, ALT, CVD, 2HPP, uric acid, HbA1c, waist-to-hip ratio, cholesterol, LDL, HDL, FBS, triglyceride, and serum insulin. Based on a 10-fold cross-validation, the best performance among the five classification algorithms was that of the random forest with 85% AUC. This investigation validates the known risk factors for DN and emphasizes the importance of controlling the blood pressure, weight, cholesterol, and blood sugar of T2DM patients. In addition, as an example of the application of ML approaches in medical predictions, the findings of this study demonstrate the advantages of using these techniques.