DiaGuide

DiaGuide

Leader posted 3 min read

DiaGuide: Diabetes Risk Prediction App

Introduction

Hi there!
I built my first fully functional website, implementing AI to predict diabetes risk using historical data. This was my first time publishing a real, working website—and I am honestly proud of the result. And I built all this during 48-hour hackathon, working solo.
I used Streamlit for the UI, scikit-learn for the AI training, and a model. Here is how:

The Idea

When the project topic was first released, I was slightly surprised to see healthcare — most of the hackathons I had joined previously allowed more open-ended, general tech solutions. But then I started thinking , and this pushed me to research more deeply.
Since I was good at data analysis and developing ML models, I decided to focus on those areas. I spent all of Friday and Saturday morning brainstorming ideas. I actually came up with a couple :

  • Medication Tracker App

    • An app to keep track of daily medication while allowing users to note how effective each medication is.
    • ✅ Easy to implement
    • ❌ The idea wasn't original enough
    • ❌ I wasn’t sure how to keep track of the data on a web server
    • ❌ I didn’t have enough time to learn and build a mobile app
  • Symptom-Based Doctor Recommendation

    • A questionnaire to determine whether the person needs to go to the doctor.
      • ✅ Useful in real life
      • ❌ Too broad
      • ❌ Hard to implement with all the parameters and questions
      • ❌ Hard to find a reliable database to use

Because of the reasons I mentioned above, I decided to pivot. But I still liked the idea of using a questionnaire to determine something important.
So I shifted gears to something more specific — a disease or mental health condition. I was very indecisive at first, but then I found a very useful diabetes dataset, and the parameters made sense to me. That’s when I committed to building DiaGuide.

⚙️ Tools & Stack

Language(s): Python

Frontend

  • Tools & Libraries: Streamlit
  • ❓ Why I chose it: I needed a simple library that I could use to create layout and I needed it fast ♂️. As someone who doesn't have much experience in frontend design, Streamlit helped me a lot with being beginner-friendly and having a good documentation and tutorials. It was the perfect tool to create data-heavy app that requires minimal UI design.
  • ️ How I used it: It was basically the cornerstone of my UI. Everything—from layout to interactivity—was built using Python. No HTML, no CSS, just clean Python code.

Machine Learning

  • Tools & Libraries: scikit-learn
  • Model Type(s): Logistic Regression, Random Forest, Gradient Boosting
  • Data Cleaning Libraries: Pandas, Numpy
  • Performance/Evaluation: I created 3 different models and evaluated each one of them by getting their ROC curve. This evaluation checks how successful the model is using the test sample when 1 = exact, 0.5 = same as randomly choosing:
    • Logistic Regression: 0.81, very fast ⚡
    • Gradient Boosting: 0.82, okay speed ⌛
    • Random Forest: 0.77, slows down the code significantly and slower server response
    • Result: Logistic Regression—it didn't have much accuracy difference with Gradient Boosting but was significantly faster.

Dataset

  • Source: Kaggle / UCI Machine Learning Repository
  • Link: https://www.kaggle.com/datasets/alexteboul/diabetes-health-indicators-dataset/data
  • Features Used: BMI, Age, Blood Pressure, etc.
  • Why this dataset: ✅ Clean, ️ labeled, interpretable
  • Additional Notes: I didn't use two of the columns in the database—education level and income—because I thought they were more personal. Also, I evaluated with and without them and they only increased the accuracy by 1%, which is not significant.

Hosting & Deployment

  • Where I deployed: Streamlit Cloud
  • GitHub Repository: SuleymanSade/DiaGuide
  • Streamlit App: DiaGuide App
  • How I did it: I put all the libraries I used into requirements.txt ➡️ Configured Git LFS to fit my models (since some of them were bigger than 100MB) ➡️ Created a GitHub repo & pushed the code ➡️ Set up Streamlit Cloud and it was ready to go
  • Why I used Streamlit Cloud: It was free-to-use and really simple to set up. It also connected to the repository, so if I make a change in the future, the website is going to update too.

I write about learning AI by building real tools, not just tutorials.

If you read this far, tweet to the author to show them you care. Tweet a Thanks

Really impressive work Suleyman, building a full AI-powered web app solo in just 48 hours is no small feat. I’m curious, did you face any challenges with the dataset while training the models and how did you decide on which features to include or exclude?

Hi Andrew,

Thank you for your comment. When I was building DiaGuide, finding a dataset took some time but I figured it out. My initial problem was forgetting to read the info about dataset properly, there were actually two datasets one specifying the type of diabetes and other that only had information about whether or not the person had diabetes.

Another problem was with 2 parameters in the dataset, one asked for income and other about graduation. I found that kind of exclusive as I believe the income shouldn't matter too much for a topic like having diabetes, so I discluded them. And when I run the tests it only played 2% difference in succes. I hope this answers your question.

More Posts

How I Created a Custom Browser — And What It Taught Me

FelixFab - Jun 27

Web Performance Optimization with NgOptimizedImage in Angular

Sunny - Jun 9

Understanding Equality in C# with IEquatable, Not Equals and ==

Spyros - Feb 6

Grateful for the Devs Who Keep the World Running

rahul mishra - Jul 17

Beyond the Code: Staying Ahead in an AI-Assisted Developer World

István Döbrentei - Jul 9
chevron_left