Akliji Works
2025Machine Learning

Diapredict System

Diapredict logo
Project SnapshotMachine Learning
01

Project Overview

Diapredict helps spot diabetes early from routine lab results. A user enters 11 values (age, gender, urea, creatinine, HbA1c, cholesterol, triglycerides, HDL, LDL, VLDL, and BMI) and instantly gets a Diabetes or Non-Diabetes prediction with its probability. The project covers the full machine learning workflow, from preparing clinical data and comparing models to deploying the selected model as a live web dashboard.

02

The Challenge

  • Turn routine lab results into an early warning, before complications appear.
  • Catch every diabetic patient, since a missed case costs far more than a false alarm.
  • Build a reliable model from real clinical records collected in hospitals.
  • Make the model usable by anyone through a simple web form.
03

The Solution

  • Structured workflow: followed CRISP-DM from business understanding and data understanding through preparation, modeling, evaluation, and deployment.
  • Clinical data preparation: worked with 1,000 patient records from hospitals in Iraq (Mendeley Data), removed identifiers, standardized inconsistent labels, and removed duplicates, leaving 826 clean records.
  • Insightful analysis: explored every feature with distributions and Spearman correlation, identifying HbA1c, BMI, and age as the strongest signals.
  • Careful preprocessing: normalized features with MinMaxScaler, used a stratified 80/20 split, and balanced the training data with SMOTE while keeping the test set untouched.
  • Thorough model comparison: trained Logistic Regression, Decision Tree, Random Forest, and XGBoost on both the original and SMOTE data, and evaluated all 8 combinations on accuracy, precision, recall, and F1 score.
  • Trust over a perfect score: two SMOTE models scored a perfect 1.0 on every metric, a sign that synthetic samples overlapped the test data, so Random Forest on the original data was selected as the most reliable model.
  • Live deployment: built a Streamlit dashboard with sensible input ranges, helper notes for each lab value, a probability score, and a clear reminder that results support screening rather than replace a diagnosis.
Diapredict CRISP-DM workflow in six steps, from business understanding to deployment
04

Key Features

  • Prediction form for 11 lab and patient inputs, with helper notes
  • Instant Diabetes or Non-Diabetes result with its probability
  • Comparison of 8 model and data combinations
  • Per-class evaluation and confusion matrix for the selected model
  • Reproducible training script and a fully documented Jupyter notebook
  • Live web dashboard, free to try
05

Outcome & Reflection

  • Random Forest reached 98.8% accuracy, 98.7% precision, 100% recall, and a 99.3% F1 score on 166 unseen patients.
  • Every diabetic patient in the test set, 147 of 147, was identified correctly.
  • Live on Streamlit, so anyone can run a screening in seconds.
06

Tech Stack

A focused stack selected for the project requirements, platform constraints, and delivery scope.

Pythonscikit-learnXGBoostimbalanced-learn (SMOTE)pandasNumPyMatplotlibSeabornJupyter NotebookStreamlit