Abstract
Type 2 Diabetes Mellitus (T2DM) is one of the most dangerous diseases because of the growing number of cases, the range of serious complications, and the significant costs to the economies. Detecting or classifying T2DM subtypes in the early stages will help improve care and treatment. This research developed and evaluated machine learning (ML) models to detect T2DM intelligently and classify it into subtypes. The data used in this study were obtained from the University of Nigeria Teaching Hospital (UNTH), Enugu, and Parklane Hospital, Enugu State. The data collected from the hospitals comprised 23,300 confirmed cases of T2DM recorded between 2002 and 2024. The data were preprocessed using the Cross-Industry Standard Process for Data Mining (CRISP-DM). The study used seven ML algorithms including Decision Tree (DT), Random Forest (RF), Support Vector Machine (SVM), K-Nearest Neighbour (KNN), Naïve Bayes (NB), Multi-Layer Perceptron (MLP), and Extreme Gradient Boosting (XGBoost). This research classified patients into four categories of T2DM: Mild Age-Related Diabetes (MARD), Mild Obesity-Related Diabetes (MOD), Severe Insulin-Deficient Diabetes (SIDD), Severe Insulin-Resistant Diabetes (SIRD). The performance of the ML models was evaluated using Accuracy, Precision, Recall, F1-score, and Area under Curve (AUC). The results revealed that XGBoost, Random Forest, and SVM recorded the highest accuracy of 98.35%, 98.24%, and 98.20%, respectively. The study concluded that machine learning algorithms can be used to detect and classify T2DM subtypes. Thus, developing an accurate and cost-effective framework for classifying T2DM subtypes has the potential to improve decision-making in managing the disease.