Diabetes Classification Using the Random Forest Method with Chi-Square Feature Selection

Authors

  • Evi Kurniati Universitas Sulawesi Barat, Majene, Sulawesi Barat, Indonesia
  • Arnita Irianti Universitas Sulawesi Barat, Majene, Sulawesi Barat, Indonesia
  • Wawan Firgiawan Universitas Sulawesi Barat, Indonesia

DOI:

https://doi.org/10.62411/tc.v25i4.18118

Abstract

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, Classification

Downloads

Published

2026-11-30