Diabetes Classification Using the Random Forest Method with Chi-Square Feature Selection
DOI:
https://doi.org/10.62411/tc.v25i4.18118Abstract
Identifying diabetes and prediabetes early supports risk assessment and preventive care. This study pairs Chi-Square feature selection with Random Forest to classify diabetes-related indicators, using the CDC Diabetes Health Indicators dataset from the UCI Machine Learning Repository. Duplicate removal was followed by stratified sampling that produced 30,000 observations, and an 80:20 ratio divided them into training and testing portions. Six Random Forest scenarios were tested. One used all 21 features, and the other five used the 5, 8, 10, 15, and 20 top-ranked features. Five-fold cross-validation scored each scenario on seven measures: accuracy, balanced accuracy, precision, recall, F1-score, ROC-AUC, and the Matthews correlation coefficient. The Top-20 scenario gave the highest cross-validation accuracy (83.78%) and ROC-AUC (78.52%), a marginal gain over the baseline. After hyperparameter optimization, a threshold of 0.60 gave Random Forest an F1-score of 48.48%, a recall of 62.75%, and a ROC-AUC of 81.62% on the test set. Among the comparison models, XGBoost had the highest cross-validation ROC-AUC (80.49%) and SVM had the highest F1-score (43.28%). These findings show that feature selection and multiple evaluation metrics matter when models work with imbalanced health data. Keywords - Diabetes, Random Forest, Chi-Square, Feature Selection, ClassificationDownloads
Published
Issue
Section
License
Copyright (c) 2026 Evi Kurniati, Arnita Irianti, Wawan Firgiawan, Wawan Firgiawan

This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.
License Terms
All articles published in Techno.COM Journal are licensed under the Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0). This means:
1. Attribution
Readers and users are free to:
-
Share – Copy and redistribute the material in any medium or format.
-
Adapt – Remix, transform, and build upon the material.
As long as proper credit is given to the original work by citing the author(s) and the journal.
2. Non-Commercial Use
-
The material cannot be used for commercial purposes.
-
Commercial use includes selling the content, using it in commercial advertising, or integrating it into products/services for profit.
3. Rights of Authors
-
Authors retain copyright and grant Techno.COM Journal the right to publish the article.
-
Authors can distribute their work (e.g., in institutional repositories or personal websites) with proper acknowledgment of the journal.
4. No Additional Restrictions
-
The journal cannot apply legal terms or technological measures that restrict others from using the material in ways allowed by the license.
5. Disclaimer
-
The journal is not responsible for how the published content is used by third parties.
-
The opinions expressed in the articles are solely those of the authors.
For more details, visit the Creative Commons License Page:
? https://creativecommons.org/licenses/by-nc/4.0/









