--- title: Gallstone Risk Demo emoji: ๐Ÿฉบ colorFrom: green colorTo: gray sdk: docker app_port: 8000 pinned: false license: mit short_description: Rural adaptation of UCI Gallstone (GB + SHAP + bioimpedance) --- # Gallstone Risk โ€” FastAPI backend Rural-adaptation inference API for a gallstone disease ML case study. Serves a scikit-learn `Pipeline(StandardScaler โ†’ GradientBoostingClassifier)` trained on the UCI Gallstone dataset (319 records, 25 features โ€” no blood lab work), plus a SHAP `TreeExplainer` and a bioimpedance template generator. - **Model metrics:** Accuracy 0.7708, AUC 0.8138 - **Frontend:** [gallstone.rosewt.dev](https://gallstone.rosewt.dev) (Next.js / Vercel) - **Source:** [github.com/rosewt-upc/WinterProject](https://github.com/rosewt-upc/WinterProject) ## Endpoints | Method | Path | Purpose | |---|---|---| | `GET` | `/health` | Liveness + model/explainer load state | | `GET` | `/model/info` | Metrics JSON from training run | | `POST` | `/predict/rural` | 25-feature payload โ†’ probability + risk_level | | `POST` | `/explain/rural` | Same payload โ†’ SHAP values + base_value | | `POST` | `/generate/bioimpedance` | Demographics โ†’ 15 synthetic bioimpedance vars | Validate with the Postman collection shipped in the source repo (`demo/backend/postman_collection.json`, 31 assertions). --- _Academic project ยท UPC 2024 ยท Does not replace medical diagnosis._