Back Aidan Liu
01 · Delta Institute · AWS Work Experience Program

Diabetes Risk
Prediction with ML

Jul – Aug 2025 Python · scikit-learn · CDC BRFSS
70,692 Dataset rows
22 Raw features
75.1% Best accuracy
5 Model configs

The dataset came from the CDC BRFSS 2015 survey — a nationally representative telephone survey on health behaviours and conditions. The version used was already pre-balanced to a 50/50 diabetes/non-diabetes split, removing the need for SMOTE or class weighting.

Most of the 22 columns are binary or ordinal categorical variables (e.g. HighBP, HighChol). Preprocessing involved checking for nulls (none found), applying min-max normalization across all numerical columns, and confirming no duplicate rows. Work was split into two tracks: Track A kept all 18 meaningful features for initial LR and RF experiments, while Track B aggressively pruned to 9 to reduce noise for eventual neural network training.

Track B — kept (9 features)
BMI Age GenHlth PhysHlth HighBP HighChol CholCheck HeartDiseaseorAttack DiffWalk
Dropped (13 features)
SmokerFruits VeggiesHvyAlcoholConsump AnyHealthcareNoDocbcCost MentHlthSex StrokePhysActivity IncomeEducation Diabetes_binary

Before building any models I ran a full EDA pass to understand distributions, class separation, and inter-feature correlations. The BMI boxplot immediately showed diabetic respondents had a noticeably higher median BMI (~31) compared to non-diabetic (~27), with wider spread — making it the clearest single visual separator in the dataset.

The BMI histogram confirmed the distribution is right-skewed (mean ≈ 29.9) with the peak around 28–30. The pairplot revealed BMI and Age together provide the cleanest cluster separation. The correlation heatmap (darker = stronger correlation) showed GenHlth had the second-highest correlation with diabetes at 0.41, much stronger than most other binary indicators.

40 35 30 25 20 No Diabetes Diabetes
BMI by Diabetes Status
15 28 43
BMI Distribution (right-skewed, mean ≈ 29.9)
BMI Age HighBP BMI No diabetes Diabetes
Pairplot — BMI & Age separate cleanest
Diab. BMI Age GenHlth HighBP Diab. BMI Age GenHlth 1.0 .22 .22 .41 .28 .22 1.0 .12 .22 .17 .22 .12 1.0 .24 .25 .41 .22 .24 1.0 .27 1.0 0.5 0.0
Correlation Heatmap (top 5 features)

After training Random Forest on the 18-feature Track A dataset, I extracted permutation importances and compared them against Logistic Regression L2 coefficients. Both ranked BMI at the top by a wide margin — RF importance 0.170 vs. next-highest Age at 0.127. The LR coefficient for BMI was 6.25, compared to GenHlth at 2.35 and HighBP at 1.88.

This cross-validated ranking directly informed Track B’s feature selection: the 9 kept features were chosen by combining the top RF importances with clinical reasoning (e.g. HighChol and CholCheck are closely linked to BMI-driven metabolic risk).

BMI Age GenHlth Income HighBP PhysHlth HighChol 0.170 0.127 0.107 0.084 0.075 0.068 0.041

I ran five progressive experiments on Track A, varying regularization type, interaction terms, and Optuna hyperparameter tuning. Test 0 used a plain baseline. Tests 1–3 introduced L1/L2 regularization and manually engineered interaction terms (BMI × Age, BMI × HighBP, Age × GenHlth). Test 4 added ElasticNet. Each was evaluated on the same 80/20 train-test split for both LR and RF.

Test 2 (L2 + interaction terms) was best for both models: LR 75.10%, RF 75.06%. Across all configs the two models stayed within 1.6 percentage points, suggesting the dataset ceiling is around 75% for linear approaches without deeper engineering.

73% 74% 75% 76% Logistic Regression Random Forest Test 0 Baseline 74.75 73.47 Test 1 L1 + feat. eng. 75.09 74.88 ◆ best Test 2 L2 + interactions 75.10 75.06 Test 3 L2, minimal eng. 74.88 75.03 Test 4 ElasticNet 74.93 74.89

Track A used a standard 80/20 train-test split across all five experiments. For Track B, I switched to a 60/20/20 split to create a dedicated validation set — necessary for tuning a neural network without contaminating the held-out test set. The balanced dataset meant no stratified split was required.

60% Train
20% Val
20% Test
~42,415 rows (train) ~14,138 rows (val) ~14,139 rows (test)
01 L2 beat L1 and ElasticNet — L2 regularization preserved all feature weights including weaker predictors that contributed small signal. L1 sparsity was counterproductive here because it eliminated interaction terms that added meaningful lift.
02 Manual feature engineering > Optuna tuning — Adding interaction terms (BMI × Age, BMI × HighBP, Age × GenHlth) moved LR accuracy by 0.34%, while Optuna hyperparameter search added only ~0.01%. Domain reasoning outperformed automated search on this dataset.
03 BMI dominated all rankings — RF importance 0.170 vs. Age at 0.127; LR coefficient 6.25 vs. GenHlth at 2.35. Diabetic respondents had a visibly higher median BMI (~31 vs. ~27), confirming it as the single most predictive feature.

At the end of the program, our team presented the full project to a panel of AWS employees and Delta Institute mentors. We walked through the end-to-end pipeline — from data sourcing and EDA through feature selection, model iterations, and final results. The audience included working data scientists and cloud engineers who asked detailed questions about our methodology.

AWS Panel Delta Institute AWS Work Experience Program — Final Showcase

Key feedback received from the panel: