Diabetes mellitus is a deadly disease caused by the failure of the pancreas to produce enough insulin. Indonesia ranks fifth in the world with the number of people with diabetes in 2021 at around 19.47 million, and this number continues to increase. One of the main challenges in diabetes management is to make the right classification between type 1 and type 2 diabetes, as misdiagnosis can result in inappropriate treatment and worsen the patient's condition. This study uses a machine learning approach to compare Decision Tree and Random Forest methods in classifying type 1 and type 2 diabetes mellitus. The goal is to identify the most effective model in predicting the type of diabetes based on medical record data. The comparison was done using k-fold cross validation and confusion matrix. The results showed that Random Forest provided an average accuracy of 94%, while Decision Tree reached 93% during cross validation testing. Although both models were able to perform well in classification, Random Forest showed a more stable performance and a slight edge in accuracy over Decision Tree. Evaluation with the confusion matrix showed that the Decision Tree model achieved 93% accuracy compared to Random Forest's 91%. In addition, the Decision Tree model also had a lower number of prediction errors, 7, compared to 9 for Random Forest. The most influential variables in classification also differed between the two models, showing the unique advantages and characteristics of each approach.
                        
                        
                        
                        
                            
                                Copyrights © 2024