Skip to content

SaranyaNarayana/diabetes-ml-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🩺 Diabetes Risk & Socioeconomic Status — Machine Learning Analysis

This project applies machine learning techniques to investigates the relationship between socioeconomic status (income and education) and diabetes prevalence using the Diabetes Health Indicators Dataset from the CDC's Behavioral Risk Factor Surveillance System (BRFSS).

This project was completed as part of a machine learning course at University of Waterloo.


Hypothesis

There is a significant negative correlation between socioeconomic status (income and education) and diabetes prevalence. Specifically, individuals in the lowest income bracket are at least twice as likely to have diabetes as those in the highest income bracket.


Dataset

Property Detail
Source Kaggle — Diabetes Health Indicators Dataset
Origin CDC Behavioral Risk Factor Surveillance System (BRFSS) 2015
File used diabetes_binary_health_indicators_BRFSS2015.csv
Rows 253,680 survey respondents
Features 21 health and demographic variables
Target Diabetes_binary — 0 = No diabetes, 1 = Diabetes / Pre-diabetes
Class balance ~86% No diabetes / ~14% Diabetes (imbalanced)

Key Features Include:

  • BMI, Age, Sex
  • High Blood Pressure, High Cholesterol
  • Smoking, Alcohol Consumption, Physical Activity
  • Fruits & Vegetable Consumption
  • Access to Healthcare, Education, Income Level

Key steps

1. Exploratory Data Analysis

  • Diabetes rate by income bracket (bar chart)
  • Diabetes rate by education level (bar chart)
  • Income × Education heatmap showing combined SES effect
  • Full feature correlation heatmap
  • Feature correlations with target (Income & Education highlighted)

2. Hypothesis Testing (before any ML)

  • Computes diabetes prevalence rate per income bracket and calculates the low/high prevalence ratio
  • Runs chi-square tests for Income vs Diabetes and Education vs Diabetes
  • Computes point-biserial correlations to confirm the direction of the SES relationship

3. Data Preparation

  • 80/20 stratified train/test split
  • StandardScaler applied for Logistic Regression and SVM
  • class_weight="balanced" used across all models to handle class imbalance

4. Four Models Trained

  • Logistic Regression
  • Random Forest
  • Decision Tree
  • SVM

5. Evaluation

  • Confusion matrices, ROC curves, classification reports
  • Metrics: ROC-AUC, Accuracy, F1 (macro), Recall for diabetic class

6. Feature Importance

  • Logistic Regression: absolute coefficients
  • Decision Tree / Random Forest: Gini impurity reduction
  • Aggregated normalized importance across all three models
  • Income and Education ranked among all 21 features

Project Structure

diabetes-ml-project/
│
├── data/
│   └── diabetes_012_health_indicators_BRFSS2015.csv
├── notebooks/
│   ├── 01_eda.ipynb
│   ├── 02_hypothesis_testing.ipynb
│   └── 03_modeling_1.ipynb
│   └── 04_modeling_2.ipynb
│   └── 05_Evaluation_feature_importance.ipynb
├── .gitignore
└── README.md

Branching Strategy

Branch Purpose
main Stable, reviewed code only
feature/EDA_analysis Exploratory Data Analysis
feature/hypothesis_test Hypothesis_test
feature/model_training_1 Logistic regression, Random forest modeling
feature/model_training_2 Decision Tree & SVM modeling
feature/evaluation Evaluation & Feature Importance

Team

Name Role
Taejin Jung EDA & Visualization
Saranya Narayna Hypothesis testing, & logistic regression, Random forest modeling
Chu-Lan Fu Decision Tree & SVM modeling
Elvis Barah Evaluation & Feature Importance

Setup Instructions

1. Clone the Repository

git clone https://github.com/SaranyaNarayana/diabetes-ml-project.git
cd diabetes-ml-project

2. Launch Jupyter Notebook

jupyter notebook

About

This project applies machine learning techniques to predict diabetes risk using the Diabetes Health Indicators Dataset from the CDC's Behavioral Risk Factor Surveillance System (BRFSS).

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors