Predicting childhood stunting in Kenya using KDHS survey data.
# Child Stunting Risk Predictor — App
A small Streamlit app that lets a parent or a health worker enter a child's
details and get a stunting-risk prediction (Severe / Moderate / Normal
growth) plus plain-language dietary guidance. Built on the model trained in
`Predicting_Childhood_Stunting_in_Kenya.ipynb`.
The model now also uses vaccination history \u2014 BCG, polio, DPT-HepB-Hib
(pentavalent, sometimes called "DPTH"), and rotavirus dose counts \u2014
sourced from the KDHS immunization module. These fields only appear in the
app's **Health worker** mode, since they require reading a vaccination card;
in **Parent / caregiver** mode they're left unknown and the model falls back
to its learned defaults for them.
## Files
- `app.py` — the app itself
- `stunting_classifier.joblib` — the trained model pipeline
- `model_metadata.json` — feature list, class labels, and test-set metrics
- `requirements.txt` — exact package versions to install
## Run it offline (e.g. on a clinic laptop with no internet)
1. Install Python 3.10+ if it isn't already installed.
2. In this folder, run:
```
pip install -r requirements.txt
streamlit run app.py
```
3. Streamlit opens automatically in a browser at `
localhost`.
No internet connection is needed after the one-time install — everything
(the model, the app) runs locally on the machine.
## Put it on the web (so it opens from a phone/browser link)
Easiest free option — **Streamlit Community Cloud**:
1. Push this folder to a GitHub repo.
2. Go to
share.streamlit.io, sign in, and point it at the repo /
`app.py`.
3. It builds and gives you a public URL (e.g.
`
your-app-name.streamlit.app`) that works on any phone or laptop
browser — no install needed on the user's end.
Any other host that runs a Python web app (Render, Railway, a hospital's own
server, etc.) works the same way — the app has no special requirements
beyond what's in `requirements.txt`.
## Important limitations to keep in front of users
- Th …