Skip to content

Rana-yamach/Health-Risk-AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🇹🇷 AI Health Policy Simulator (Turkey)

An interactive Machine Learning application that simulates how dietary habits and demographic factors impact cardiovascular mortality rates. Designed for policymakers and health officials, this tool uses a Random Forest model to predict health outcomes and generate actionable policy interventions.

🚀 Live Demo

(https://huggingface.co/spaces/sakurana/health-policy-simulator-turkey)


🎯 Project Overview

Cardiovascular disease is a leading cause of global mortality. This project aims to move beyond static statistics by providing a dynamic "What-If" simulator. Users can adjust macro-level variables (e.g., national wheat consumption, sugar intake, demographic shifts) to see instant predictions on mortality risk.

Key Question: How would a 20% reduction in sugar consumption or a subsidy on vegetables impact heart disease mortality in Turkey?


✨ Features

  • Predictive Engine: Uses a trained Random Forest Regressor (R² ~0.85) to forecast cardiovascular mortality rates.
  • Interactive Simulation: Streamlit-based UI allows real-time adjustment of policy levers (Wheat, Sugar, Veggies, etc.).
  • Smart Policy Insights: Automatically generates context-aware government recommendations (e.g., "Implement SSB Tax", "Subsidize Alternative Grains") based on current slider inputs.
  • Risk Badging: Visual indicators for "High Risk" vs "Optimal" dietary zones.

🛠️ Tech Stack

  • Frontend: Streamlit
  • Machine Learning: Scikit-learn (Random Forest)
  • Data Processing: Pandas, NumPy
  • Deployment: Docker / Hugging Face Spaces

📂 Repository Structure

├── data/                  # Original and processed datasets
├── docs/
├── notebooks/             # Jupyter notebooks for EDA, training, and evaluation
├── src/                   # Source code for the application
│   ├── config.py          # Configuration paths and variables
│   ├── inference.py       # Model loading and prediction logic
│   ├── streamlit_app.py   # Main dashboard application
│   ├── final_model.pkl    # Trained Random Forest model (LFS tracked)
│   └── feature_names.pkl  # List of features used during training
├── requirements.txt       # Python dependencies
└── README.md              # Project documentation

⚙️ Installation & Setup

1. Clone the Repository

git clone [https://github.com/your-username/health-policy-simulator-turkey.git](https://github.com/your-username/health-policy-simulator-turkey.git)
cd health-policy-simulator-turkey

2. Create a Virtual Environment

python -m venv venv
source venv/bin/activate  # On Windows use: venv\Scripts\activate

3. Install Dependencies

pip install -r requirements.txt

4. Run the Application

streamlit run src/streamlit_app.py

📊 Model Details

  • Algorithm: Random Forest Regressor

  • Training Data: Unified global health dataset (1990-2024) spanning 193 countries.

  • Key Features:

    • Dietary Composition (Sugar, Fat, Wheat, Rice)

    • Demographics (Age, Gender)

    • Engineered Features: Risk_Metabolic_Combo (Sugar × Fat), Ratio_Veg_to_Grain.


📝 License

This project is for educational and policy simulation purposes.

About

End-to-end ML policy simulator predicting cardiovascular mortality based on diet & demographics. Uses Random Forest to analyze risk factors in Turkey vs. the World.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors