Web App Screenshot

Built a full-featured diabetes prediction platform that combines machine learning with interactive data analysis. The project started as part of my capstone but evolved into a comprehensive tool with separate modules for prediction, exploratory data analysis, and educational visualizations.

Technical Overview

The platform processes clinical data including glucose levels, BMI, HbA1c, age, and lifestyle factors to predict diabetes risk. I evaluated five different ML algorithms before selecting logistic regression for its interpretability in medical contexts.

Key Components:

  • Prediction Engine: Logistic regression model achieving 95.97% accuracy and 0.9587 ROC-AUC
  • Interactive Dashboard: Real-time predictions with visual feedback on health metrics
  • EDA Module: Statistical analysis and visualizations of the 100,000-record training dataset
  • Educational Features: Shows how each health metric influences the prediction

Implementation Details

The interesting challenges came from balancing model performance with interpretability. While gradient boosting models achieved slightly higher accuracy, logistic regression’s coefficient interpretation was crucial for helping users understand their risk factors.

I implemented comprehensive data preprocessing pipelines using StandardScaler for numerical features and OneHotEncoder for categorical variables. The model uses L2 regularization to prevent overfitting on the large dataset.

The Streamlit interface required careful optimization - caching the model load, managing session states for multiple users, and ensuring responsive performance even with complex visualizations running simultaneously.

Research and Validation

This wasn’t just a coding project - I wrote a full research paper comparing different algorithms:

  • Logistic Regression: Selected for interpretability and consistent performance
  • SVM: Similar accuracy but black-box nature made it unsuitable
  • Random Forest: Marginally better performance but harder to explain to users
  • XGBoost: Best raw accuracy but computational overhead wasn’t justified
  • KNN: Poor performance on this high-dimensional medical data

The mathematical foundations were important - understanding why the sigmoid function works for probability estimation and how regularization prevents overfitting on medical data with many correlated features.

Lessons Learned

Medical ML is different from typical ML projects. Interpretability matters more than raw accuracy. A 96% accurate model that doctors can understand beats a 98% black box. The project taught me about the regulatory and ethical considerations in healthcare technology.

The full implementation includes proper error handling, input validation for medical ranges, and clear disclaimers about not replacing professional medical advice.

Links