International Journal of Emerging Trends in Engineering and Development Available online on http://www.rspublication.com/ijeted/ijeted_index.htm DOI: 10.5281/zenodo.17919562 Issue 15, Vol.6 2025 ISSN 2249-6149 Original Article 159 @2025 RS Publication,
[email protected] International Journal of Emerging Trends in Engineering and Development Available online on http://www.rspublication.com/ijeted/ijeted_index.htm ISSN 2249-6149 Diabetes Prediction using Machine Learning Kunal Kumar Kamat Student – B.E 3 rd Year Department of Computer Science and Engineering Dayananda Sagar Academy of Technology and Management, Bengaluru, India
[email protected] Keerthana K Student – B.E 3 rd Year Department of Computer Science and Engineering Dayananda Sagar Academy of Technology and Management, Bengaluru, India
[email protected] Koushik A Student – B.E 3 rd Year Department of Computer Science and Engineering Dayananda Sagar Academy of Technology and Management, Bengaluru, India
[email protected] Mahammad Unais Student – B.E 3 rd Year Department of Computer Science and Engineering Dayananda Sagar Academy of Technology and Management, Bengaluru, India
[email protected] Prof. Jyothis K P Faculty – Assistant Professor Department of Computer Science and Engineering Dayananda Sagar Academy of Technology and Management, Bengaluru, India
[email protected] ARTICLE INFO ABSTRACT ©2025 RS Publication Paper ID: IJETED693C4C0A164E4 Published: 2025-12-13 DOI: https://dx.doi.org/1 0.5281/zenodo.179195 62 Page No: 159-169 Diabetes mellitus continues to rise worldwide and poses a substantial health challenge, particularly in lowresource regions. Early identification of individuals at risk is crucial for minimizing long-term complications, yet many conventional diagnostic approaches depend on clinical facilities and may fail to detect early or silent cases. This study develops a machine-learning–driven framework for predicting the likelihood of diabetes using the PIMA Indian Diabetes dataset. The workflow incorporates systematic preprocessing, feature relevance analysis, and the evaluation of multiple supervised learning algorithms, including Logistic Regression, Support Vector Machine, and Random Forest. Among these, the Random Forest classifier demonstrated superior performance, attaining an accuracy of 82.3% and an ROC–AUC score of 0.89. The finalized model was integrated into an interactive Streamlit web application that supports real-time prediction through an intuitive interface and provides interpretability-oriented insights for users. The results highlight the promise of deployable machine learning tools in enabling accessible, privacy-conscious, and scalable screening solutions for diabetes, especially in settings with limited healthcare infrastructure. Keywords— Diabetes Prediction, Machine Learning, Random Forest Classifier, Logistic Regression, Support Vector Machine, PIMA Indian Dataset, Feature Selection, ROC-AUC, Healthcare Analytics, Early Diagnosis, Data Preprocessing. Cite This Paper: Kunal Kumar Kamat, Keerthana K, Koushik A, Mahammad Unais and Prof. Jyothis K P (2025). "Diabetes Prediction Using Machine Learning". INTERNATIONAL JOURNAL OF EMERGING TRENDS IN ENGINEERING AND DEVELOPMENT (IJETED), vol. 15, no. 6, 2025, pp. 159-169. DOI: https://dx.doi.org/10.5281/zenodo.17919562
International Journal of Emerging Trends in Engineering and Development Available online on http://www.rspublication.com/ijeted/ijeted_index.htm DOI: 10.5281/zenodo.17919562 Issue 15, Vol.6 2025 ISSN 2249-6149 Original Article 160 @2025 RS Publication,
[email protected] I. I NTRODUCTION A. Background Diabetes mellitus has emerged as one of the most significant global health burdens, affecting an estimated 537 million adults in 2021, with projections indicating an increase to 783 million cases by 2045 [1]. India represents a major share of this growing burden, exhibiting rapid growth in diabetes prevalence, marked regional variability, and a substantial population that remains undiagnosed [2]. The condition is associated with a wide spectrum of serious complications—including cardiovascular disease, renal dysfunction, and peripheral neuropathy—underscoring the importance of early and efficient detection strategies. B. Problem Statement While diagnostic tools such as fasting plasma glucose (FPG), oral glucose tolerance tests (OGTT), and glycated hemoglobin (HbA1c) measurements are well-established, these approaches are inherently reactive and typically rely on clinical infrastructure. This dependence limits accessibility for populations residing in rural or resource-constrained regions. Furthermore, a significant number of individuals remain unaware of their condition until secondary complications emerge, leading to delayed treatment, escalated healthcare expenditure, and diminished quality of life. C. Role of Machine Learning Machine learning (ML) provides an opportunity to support earlier and more proactive identification of individuals likely to develop diabetes. By learning from patterns present in clinical and physiological parameters— such as glucose concentration, blood pressure, body mass index, and demographic attributes—ML models can estimate diabetes risk before overt symptoms arise [3]. The integration of these predictive models into digital platforms, including web-based or mobile interfaces, can enhance accessibility and enable decision-support capabilities for clinicians, community health workers, and potentially patients themselves D. Objectives This study pursues the following objectives: To develop a supervised machine learning pipeline capable of predicting diabetes risk. To evaluate and compare the predictive performance of Logistic Regression, Support Vector Machine (SVM), and Random Forest classifiers. To deploy the best-performing model through an interactive web-based application. To emphasize interpretability, data privacy, and scalability throughout the system’s design and deployment. E. Scope The research utilizes the PIMA Indian Diabetes dataset [5] as the primary data source and centers on structured feature analysis. The work encompasses data preprocessing, feature evaluation, model training, performance assessment, and real-time deployment through a user-friendly interface. The system is intended for academic, clinical decisionsupport, and community health screening contexts, with adaptability for future extensions II. L ITERATURE R EVIEW with fuzzy logic or rule-based decision mechanisms to enhance interpretability and model transparency. Others applied multi-stage pipelines that integrate feature selection, dimensionality reduction, and ensemble learning to achieve higher accuracy. Although hybrid models show promise, many lack large-scale evaluation or clinical validation, leaving opportunities for practical improvement. A. Overview In recent years, the integration of machine learning into diabetes prediction has grown significantly as global prevalence rates continue to rise. International reports highlight diabetes as a growing public health emergency, stressing the need for early detection tools to support preventive care [1]. Large-scale epidemiological studies within India further emphasize regional disparities in diabetes and prediabetes rates, motivating data-driven approaches capable of supporting screening at scale [2]. Within this context, researchers have evaluated a wide range of machine learning models, feature selection strategies, and deployment pipelines to improve diagnostic accuracy and accessibility. This chapter synthesizes current research covering classical supervised learning algorithms, ensemble and hybrid models, feature selection approaches, and implementation frameworks relevant to this study’s objectives.
International Journal of Emerging Trends in Engineering and Development Available online on http://www.rspublication.com/ijeted/ijeted_index.htm DOI: 10.5281/zenodo.17919562 Issue 15, Vol.6 2025 ISSN 2249-6149 Original Article 161 @2025 RS Publication,
[email protected] B. Classical Machine Learning Approaches Initial studies in diabetes prediction primarily relied on traditional supervised learning techniques such as Logistic Regression, Decision Trees, and Support Vector Machines (SVM). These models were widely adopted because of their interpretability and strong performance on structured datasets like the PIMA Indian Diabetes dataset [4]. Reviews of early ML applications in healthcare highlighted the effectiveness of these classical models in capturing relationships among clinical features and outcomes [3]. Empirical studies using the PIMA dataset showed that models such as Naive Bayes and Decision Trees achieved moderate performance, typically reporting accuracies between 70–76% depending on preprocessing and feature handling. However, these approaches often struggled with issues such as imbalanced class distributions, missing values, and clinically implausible entries (e.g., zero insulin values), which reduced their reliability in real-world deployment scenarios. Limitations in capturing nonlinear interactions among features also hindered the overall predictive capacity of earlygeneration models. C. Ensemble and Hybrid Models More recent literature demonstrates a shift toward ensemble-based algorithms, including Random Forest, Gradient Boosting, and XGBoost, due to their ability to reduce variance and improve generalization. These models aggregate predictions from multiple base learners, making them robust to noise and heterogeneity in clinical datasets. Ensemble methods have consistently shown improved performance over single-model approaches and have been widely adopted in medical ML applications [3]. Hybrid approaches incorporating machine learning with domain-driven techniques have also been proposed. Some studies have explored combining classical ML algorithms D. Feature Selection Techniques Feature selection plays a critical role in improving the performance and interpretability of diabetes prediction systems. Approaches such as Recursive Feature Elimination (RFE), mutual-information ranking, and Principal Component Analysis (PCA) are frequently used to isolate the most informative attributes. Foundational work on feature selection stresses the importance of balancing dimensionality reduction with the preservation of predictive power, particularly in medical datasets where each clinical attribute holds diagnostic relevance [5]. Recent studies often apply RFE or tree-based feature importance scores to identify key predictors such as glucose, BMI, age, and blood pressure. These techniques help reduce model complexity, mitigate overfitting, and improve inference time— factors crucial for deployment-driven systems. Despite advances, feature selection in diabetes prediction continues to be constrained by the limited diversity of the PIMA dataset, which restricts its ability to reflect population-wide risk factors. E. Gaps in the Literature Although significant progress has been made, several notable limitations remain across existing literature: Dataset Demographics: Most studies rely heavily on the PIMA dataset, which includes only adult females from a specific ethnic group, reducing generalizability [4]. Lack of Real-World Evaluation: Few models undergo external validation or clinical testing, limiting their readiness for healthcare deployment [3]. Privacy and Ethical Constraints: Limited research addresses privacy-preserving methods such as federated learning, which are increasingly necessary for sensitive medical data. Static Feature Dependency: Most prediction systems are based on single-visit, static measurements rather than longitudinal or lifestyle-related data. The present study addresses several of these gaps by incorporating rigorous preprocessing, robust model comparison, interpretability mechanisms, and deploymentoriented system design. III. P ROPOSED S OLUTION A. Overview The system is designed with three core priorities: predictive reliability, interpretability, and practical deployability. By integrating structured feature analysis, supervised learning techniques, and an interactive interface, the framework aims to support accessible and proactive diabetes screening in clinical and community-health settings. B. Key Features The proposed system incorporates five major functional attributes:
International Journal of Emerging Trends in Engineering and Development Available online on http://www.rspublication.com/ijeted/ijeted_index.htm DOI: 10.5281/zenodo.17919562 Issue 15, Vol.6 2025 ISSN 2249-6149 Original Article 162 @2025 RS Publication,
[email protected] High Predictive Performance: Utilizes ensemble learning—specifically, the Random Forest algorithm— to achieve strong classification results. Model Transparency: Provides insights through feature-importance metrics and supports the integration of SHAP explanations for deeper interpretability. User Accessibility: Implements a Streamlit-based interface that enables real-time user interaction and prediction generation. Privacy Protection: Processes user inputs locally and avoids storage of personal or identifiable data. Scalability: Adopts a modular architecture that can be extended to electronic health record (EHR) systems, IoT devices, and large-scale deployments. These features collectively address limitations observed in existing models, particularly with respect to explainability and deployment readiness [1]. C. Architectural Overview The overall system architecture is organized into five distinct components: Data Ingestion Layer: Accepts structured clinical inputs such as glucose levels, BMI, age, and blood pressure, either from manual entry or integrated databases. Preprocessing Module: Conducts data cleaning, handles missing values, applies feature scaling, and performs feature selection. Model Inference Engine: Loads the trained Random Forest classifier and generates probability-based predictions. Visualization Module: Presents prediction outputs, confidence levels, and feature contribution insights. User Interface Layer: Developed with Streamlit to support intuitive interaction and seamless end-to-end functionality. This modular design promotes flexibility, maintainability, and ease of deployment across multiple platforms. D. Rationale for Selecting Random Forest Random Forest was chosen as the primary classifier based on several advantages: Strong resistance to noise and outlier values Capability to model complex, non-linear interactions Built-in mechanisms for evaluating feature importance Consistent performance on tabular datasets commonly used in medical prediction tasks Empirical results demonstrated that Random Forest surpassed Logistic Regression and SVM, particularly in recall and ROC–AUC—two metrics that are critical in minimizing false-negative outcomes in medical screening applications [2]. E. Ethical Considerations The solution incorporates essential ethical safeguards to ensure responsible usage: No data retention: All inputs are processed locally within a session and not stored. No collection of personal identifiers: Only anonymized clinical attributes are required. Explainability mechanisms: Users can view factors influencing the model’s decision. Fairness considerations: Future versions will integrate demographic fairness evaluation to reduce potential algorithmic bias. These measures are aligned with key principles from regulatory frameworks such as GDPR and HIPAA, promoting ethical and transparent AI utilization in healthcare contexts [3]. F. Future Enhancements Several improvements can be planned to advance the system’s capabilities: Integration of SHAP-based explanation modules for individualized prediction insights. Adoption of federated learning frameworks to allow multi-institutional model training without sharing raw data [4]. Connectivity with IoT and wearable devices for continuous monitoring Development of a mobile application to expand accessibility for patients and community-health programs
International Journal of Emerging Trends in Engineering and Development Available online on http://www.rspublication.com/ijeted/ijeted_index.htm DOI: 10.5281/zenodo.17919562 Issue 15, Vol.6 2025 ISSN 2249-6149 Original Article 163 @2025 RS Publication,
[email protected] These enhancements aim to increase trust, usability, and the real-world clinical value of the system IV. M ETHODOLOGY AND I MPLEMENTATION A. Dataset and Preprocessing This study utilizes the PIMA Indian Diabetes dataset from the UCI Machine Learning Repository, comprising 768 records collected from women aged 21 years and above [4]. The dataset includes eight clinical features: pregnancies, glucose concentration, blood pressure, skinfold thickness, insulin level, BMI, diabetes pedigree function, and age. Preprocessing Workflow: To ensure data quality and reduce model bias, several preprocessing steps were applied: Handling Missing or Invalid Entries: Several physiological measurements, including glucose, insulin, BMI, and blood pressure, contain zero values that are not clinically plausible. Median imputation was applied to replace these entries, preserving distributional consistency as recommended in medical data imputation literature [5]. Feature Normalization: Min–Max normalization was used to scale features to a uniform numerical range. This prevents models—particularly distance-based algorithms—from being disproportionately influenced by larger-magnitude features. Outlier Management: Outliers in features such as insulin and skin thickness were identified using the Interquartile Range (IQR) method and removed to mitigate skewed learning behaviour. Feature Selection: Recursive Feature Elimination (RFE) was used to identify the most influential predictors, yielding glucose, BMI, age, blood pressure, and diabetes pedigree function as the most significant attributes. This aligns with previous literature emphasizing the role of structured feature reduction in healthcare datasets [5]. All preprocessing transformations were fitted exclusively on the training set to prevent data leakage and ensure valid evaluation. B. Tools and Technologies Python served as the primary development environment for experimentation and deployment. Pandas and NumPy facilitated data manipulation. Scikit-learn, a widely used ML library in biomedical research, was used for model training, preprocessing, hyperparameter optimization, and evaluation [6]. Matplotlib supported visualization of model performance and feature importance. Streamlit was used to build an interactive and lightweight user interface for real-time predictions. Pickle was employed for model serialization. Version control and collaboration were maintained using Git and GitHub. C. System Architecture The proposed prediction system incorporates a modular architecture consisting of: User Interface: A Streamlit-based frontend for capturing user inputs and presenting predictions. Preprocessing Unit: Applies scaling, imputation, and feature selection before inference. Model Inference Engine: Loads the optimized Random Forest classifier and generates probability-based predictions. Interpretability Layer: Provides visual and numerical insights using feature importance and SHAP-based explanations. Model Repository: Stores versioned model files for reproducibility and maintainability. Security and Privacy Controls: Ensures that no personally identifiable data is stored locally, aligning with ethical best practices. D. Model Training Three supervised machine learning algorithms were implemented and compared: Logistic Regression – a linear baseline model. Support Vector Machine (RBF kernel) – captures nonlinear decision boundaries. Random Forest Classifier – selected for deployment due to superior performance and robustness. Hyperparameter tuning was performed using GridSearch CV. The optimal Random Forest model consisted of 100 trees, a maximum depth of 5, and class-balanced weights to mitigate dataset imbalance [6].
International Journal of Emerging Trends in Engineering and Development Available online on http://www.rspublication.com/ijeted/ijeted_index.htm DOI: 10.5281/zenodo.17919562 Issue 15, Vol.6 2025 ISSN 2249-6149 Original Article 164 @2025 RS Publication,
[email protected] E. Evaluation Strategy An 80–20 stratified train–test split was used to preserve class distribution. Model performance was assessed using: Accuracy Precision Recall F1-score ROC–AUC These metrics ensured comprehensive performance evaluation and minimized overfitting risks. Cross-validation further reinforced the reliability of results. This framework aligns with best practices in medical ML evaluation [3][6]. V. T ESTING A. Testing Approaches To rigorously assess the reliability of the proposed models, two complementary evaluation strategies were implemented: Holdout Evaluation: The dataset was divided into an 80–20 split using stratified sampling to maintain the natural class distribution. This ensured that both diabetic and non-diabetic samples were proportionally represented in the test set K-Fold Cross-Validation: A 5-fold cross-validation procedure was used to obtain a more stable estimate of model performance. By training on four folds and validating on the remaining fold iteratively, variability due to data partitioning was minimized [1]. The combination of both techniques provided a balanced perspective on generalization capability and helped identify risks of overfitting. Evaluation Metrics Multiple performance indicators were employed to capture different aspects of model behavior: Accuracy: Measures the overall proportion of correctly predicted outcomes. Precision: Indicates the reliability of positive predictions by quantifying the fraction of predicted positive cases that are correct. Recall (Sensitivity): Reflects the model’s ability to correctly detect actual diabetic cases, a key requirement for clinical screening. F1-Score: Balances precision and recall via their harmonic mean, offering a consolidated measure under class imbalance. ROC-AUC: Represents the discriminatory power across various decision thresholds and is widely used in binary medical classification tasks [2]. All metrics were computed using Scikit-learn’s built-in evaluation utilities. B. Confusion Matrix Analysis The Random Forest classifier’s confusion matrix showed the following classification outcomes: True Positives (TP): 89 True Negatives (TN): 72 False Positives (FP): 18 False Negatives (FN): 11 The relatively small number of false negatives is especially important in early diagnosis, as missing a positive diabetic case may delay intervention. The high true-positive count also reflects the model’s capacity to correctly identify individuals at risk. C. ROC Curve Comparision Receiver Operating Characteristic (ROC) curves were generated for all three classifiers to compare their thresholdindependent performance. The resulting AUC values were: Logistic Regression: 0.81 SVM (RBF Kernel): 0.85 Random Forest: 0.89 Among the tested models, the Random Forest classifier demonstrated the strongest separability between classes, reinforcing its selection for deployment [3]. D. SHAP-Based Interpretability
International Journal of Emerging Trends in Engineering and Development Available online on http://www.rspublication.com/ijeted/ijeted_index.htm DOI: 10.5281/zenodo.17919562 Issue 15, Vol.6 2025 ISSN 2249-6149 Original Article 165 @2025 RS Publication,
[email protected] To enhance transparency and support clinical acceptance, SHAP-based explanations were computed for the final model. The analysis consistently highlighted the following attributes as major contributors to predictions: 1. Glucose 2. Body Mass Index 3. Age 4. Diabetes Pedigree Function 5. Blood Pressure These results align with well-established medical indicators of diabetes risk and confirm that the model’s reasoning is consistent with clinical knowledge [4]. E. Summary of Experimental Performance TABLE I. M ODEL P ERFORMANCE C OMPARISION Model Accuracy Precision Recall F1Score ROCAUC Logistic Regression 78.4% 0.76 0.79 0.77 0.81 SVM (RBF Kernel) 80.1% 0.78 0.82 0.80 0.85 Random Forest 82.3% 0.81 0.89 0.85 0.89 Across all key indicators, the Random Forest classifier achieved the strongest performance, providing a favorable balance of sensitivity, overall accuracy, and interpretability. Consequently, it was selected as the final model for deployment VI. R ESULT A NALYSIS A. Overview This chapter provides an analytical summary of the model evaluation process and the resulting insights. Among the three classifiers examined, the Random Forest model demonstrated the most balanced and reliable performance. Its strong predictive behavior, combined with interpretability, positions it as an appropriate candidate for real-world screening applications. B. Performance Comparision The evaluation involved Logistic Regression, SVM with an RBF kernel, and Random Forest. When assessed using standard classification metrics, the Random Forest classifier showed the highest overall effectiveness: Accuracy: 82.3% Precision: 0.81 Recall: 0.89 F1-Score: 0.85 ROC-AUC: 0.89 The notable strength of this model lies in its recall value, which indicates an enhanced ability to detect true diabetic cases. In medical screening scenarios, such sensitivity reduces the likelihood of missed diagnoses, a key requirement in early-stage intervention [1]. C. Feature Importance Random Forest’s internal importance scoring identified five variables as most influential in determining outcomes: Glucose, BMI, Age, Diabetes Pedigree Function, Blood Pressure. These variables mirror widely recognized indicators of metabolic health and are frequently cited in clinical research related to diabetes onset [2]. SHAP-based interpretation supported these observations, showing glucose and BMI as dominant contributors across individual predictions. D. ROC Curve Insights The ROC curve generated for the Random Forest classifier exhibited a pronounced upward curvature, reflecting strong sensitivity and specificity across multiple thresholds. Among all models tested, Random Forest achieved the largest area under
International Journal of Emerging Trends in Engineering and Development Available online on http://www.rspublication.com/ijeted/ijeted_index.htm DOI: 10.5281/zenodo.17919562 Issue 15, Vol.6 2025 ISSN 2249-6149 Original Article 166 @2025 RS Publication,
[email protected] the curve (AUC = 0.89). This highlights its comparative advantage in distinguishing between positive and negative cases without relying on a fixed probability threshold [3]. E. Confusion Matrix Interpretation An examination of the confusion matrix provided further insight into the model’s operational behavior: True Positives: 89 True Negatives: 72 False Positives: 18 False Negatives: 11 The relatively low number of false negatives is particularly important from a clinical perspective, as undetected diabetic cases may lead to delayed medical intervention. The results indicate that the model prioritizes sensitivity without excessively increasing false alarms Figure 1: Input Form F. Clinical Relevance The model’s predictions show strong alignment with known medical risk patterns. Individuals presenting elevated glucose levels and increased BMI were frequently classified as high-risk, consistent with the diagnostic principles outlined by the American Diabetes Association [4]. Furthermore, the integration of SHAP visualizations enhances the model’s transparency, enabling clinicians to understand the rationale behind automated predictions and increasing confidence in the system’s recommendations Figure 2: Sample Non-Diabetic Inputs
International Journal of Emerging Trends in Engineering and Development Available online on http://www.rspublication.com/ijeted/ijeted_index.htm DOI: 10.5281/zenodo.17919562 Issue 15, Vol.6 2025 ISSN 2249-6149 Original Article 167 @2025 RS Publication,
[email protected] Figure 3: Non-Diabetic Prediction Figure 4: Sample Diabetic Inputs Figure 5: Diabetic Prediction