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 β¦