The Effects of Community Health Worker Visits and Primary Care Subsidies on Health Behavior and Health Outcomes for Children in Urban Mali 2014
# 🧪 Diarrhea Risk Prediction Web App
This project is a **Flask-based web application** that uses a trained machine learning model to predict the **risk of diarrhea in children** based on household and healthcare-related information. The data used is from a real-world health study conducted in **Urban Mali, 2014**.
## 📊 Project Overview
The application allows users to input various child and household health details and get a **prediction of diarrhea risk (High/Low)** along with a **confidence score**. The model was trained using **XGBoost** and **RFE (Recursive Feature Elimination)** to select the most relevant features.
---
## 🚀 Features
- 🧠 Machine learning model with feature selection (RFE)
- 🎯 Risk prediction (High Risk / Low Risk)
- 📈 Visual confidence score using a dynamic progress bar
- 📄 Form inputs with descriptions for easy understanding
- 💡 Animated transitions using CSS
- 💻 Fully responsive Bootstrap UI
---
## 📁 Folder Structure
```
├── app.py # Flask backend
├── templates/
│ └── index.html # Main frontend HTML file
├── static/
│ └── background/
│ └── image.jpg # Background image for the UI
├── capstone_project_1_mali.pkl # Trained ML pipeline (scaler + RFE + XGB)
└── README.md # Project overview and documentation
```
---
## 🧠 Selected Features Used in Model
The ML model uses the following 10 features:
| Feature Name | Description |
|--------------------------|-------------|
| `OOccupier` | If the person is the main house owner (1 = Yes, 0 = No) |
| `OldFA` | Number of old health program visits (numeric) |
| `ageyear_2014` | Age of the child in years as of 2014 |
| `vaccine_card_available` | Whether a vaccine card was shown (1 = Yes, 0 = No) |
| `child_weighing_type_` | Whether the child was weighed in a clinic (1 = Yes, 0 = No) |
| `Changed_water_source` | Whether the water source was changed recently (1 = Yes, 0 = No) |
| `A …