Downloads · 30 days
13
5% of all-time downloads
Neperl/diabetes-health-indicators-study
diabetes-health-indicators-study is a machine learning model from Neperl. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for keras. The card lists the license as apache-2.0.
[](https://huggingface.co/Neperl/diabetes-health-indicators-study)
Downloads · 30 days
13
5% of all-time downloads
All-time downloads
269
Public
Repo size
43.1 MB
Likes
0
Public
Click a slice to open those files.
.joblib21.5 MB · 96%
From the Hugging Face model README
This repository contains two machine learning models trained on the BRFSS 2015 Diabetes Health Indicators Dataset (balanced 50/50 split of 70,692 rows).
Binary classification: Predict whether an individual has diabetes or prediabetes (Diabetes_binary = 1) versus no diabetes (Diabetes_binary = 0) based on 21 health indicators.
n_estimators=200, max_depth=10, min_samples_leaf=2).dropout=0.4, and Adam optimizer.| Model | Accuracy | Precision | Recall | F1-Score |
|---|---|---|---|---|
| Random Forest (Baseline) | 0.7331 | 0.7176 | 0.7687 | 0.7423 |
| Random Forest (Tuned) | 0.7488 | 0.7281 | 0.7942 | 0.7597 |
| MLP (Baseline) | 0.7435 | 0.7179 | 0.8024 | 0.7578 |
| MLP (Tuned) | 0.7512 | 0.7264 | 0.8059 | 0.7641 |
The top indicators identified by the Random Forest model:
This repository contains the following files:
diabetes_mlp_tuned.keras: The tuned Multilayer Perceptron (MLP) model.diabetes_random_forest_tuned.joblib: The tuned Random Forest classifier.scaler.joblib: The fitted StandardScaler used to normalize the feature inputs.diabetes_case_study.ipynb: The Jupyter notebook detailing the data download, exploratory analysis, preprocessing, training, tuning, and evaluation.README.md: Model card and description.To make predictions on new data, you must first preprocess and scale the features using the saved scaler.
import joblib
scaler = joblib.load('scaler.joblib')
import joblib
# Load model
rf_model = joblib.load('diabetes_random_forest_tuned.joblib')
# Preprocess and predict
# X_scaled = scaler.transform(X_raw)
# y_pred = rf_model.predict(X_scaled)
from tensorflow import keras
import joblib
# Load model
mlp_model = keras.models.load_model('diabetes_mlp_tuned.keras')
# Preprocess and predict
# X_scaled = scaler.transform(X_raw)
# y_pred_prob = mlp_model.predict(X_scaled)
The tuned MLP marginally outperformed the tuned Random Forest in accuracy, recall, and F1 score. The neural network achieved the highest recall at 80.59%, which is critical in healthcare settings to limit false negatives. However, the MLP requires significantly more training time and architecture tuning than the ensemble model. Important risk factors identified by both methods include BMI, age, and general health.
Our finding that the tuned Random Forest and tuned MLP perform similarly aligns with broader research on tabular machine learning. Grinsztajn et al. (2022) benchmarked tree models against deep learning across 45 tabular datasets, showing that tree models remain superior or competitive on medium-sized tabular data. Their study found that neural networks struggle with the irregular target functions typical of tabular data and are more sensitive to uninformative features. This explains why hyperparameter tuning did not give the MLP a clear advantage over the Random Forest in this case study.
A main limitation is that the dataset relies on self-reported survey responses, which can introduce bias. The target column also groups prediabetes and diabetes into one class. Future research could explore gradient boosting models such as XGBoost or incorporate more complex feature engineering.