# tigertim/hippomedica architecture

> Architecture diagram of the GitHub repository tigertim/hippomedica, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tigertim/hippomedica
- Repository: https://github.com/tigertim/hippomedica

## Overview

HippoMedica combines an interactive disease-risk assessment app with a reproducible training pipeline for diabetes, heart disease, and stroke. In the primary user flow, a person enters health information in the Streamlit app; the app prepares inputs, uses saved models, and presents risk predictions and model explanations. The pipeline obtains datasets, explores and preprocesses them, trains and evaluates model families, then saves model artifacts and metrics for app use. README capabilities are included where source excerpts are incomplete; the exact app-to-model loading and prediction wiring is not fully shown.

Main entry points: [`pipeline/run_pipeline.py`](https://github.com/tigertim/hippomedica/blob/main/pipeline/run_pipeline.py) (Pipeline Orchestrator), [`pipeline/05_model_storage.py`](https://github.com/tigertim/hippomedica/blob/main/pipeline/05_model_storage.py) (Model Storage), [`web_app/app.py`](https://github.com/tigertim/hippomedica/blob/main/web_app/app.py) (Streamlit Interface), [`datasets/raw`](https://github.com/tigertim/hippomedica/tree/main/datasets/raw) (Raw Datasets)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Risk Assessment App"]
  node_app["Streamlit Interface<br/>[app.py]"]
  node_input["Health Inputs<br/>[app.py]"]
  node_predict["Risk Prediction<br/>[app.py]"]
  node_explain["Results &amp; Explanations<br/>[app.py]"]
  node_performance["Performance View<br/>[app.py]"]
  node_analysis["Data Analysis View<br/>[app.py]"]
end

subgraph group_pipeline["Training Pipeline"]
  node_runner["Pipeline Orchestrator<br/>[run_pipeline.py]"]
  node_download["Dataset Download"]
  node_eda["Exploratory Analysis"]
  node_preprocess["Data Preprocessing"]
  node_train["Model Training"]
  node_storage["Model Storage"]
end

subgraph group_data["Disease Data"]
  node_raw["Raw Datasets"]
  node_processed["Processed Datasets"]
  node_explore_outputs["EDA Outputs"]
end

subgraph group_artifacts["Model Artifacts"]
  node_models["Trained Models"]
  node_scalers["Scalers &amp; Features"]
  node_metadata["Metrics &amp; Importance"]
end

node_person(("App User"))
node_providers["Dataset Providers"]

node_person -->|"uses"| node_app
node_app -->|"collects"| node_input
node_input -->|"submits"| node_predict
node_predict -->|"loads models"| node_models
node_predict -->|"loads scaling data"| node_scalers
node_predict -->|"returns predictions"| node_explain
node_app -->|"displays"| node_performance
node_performance -->|"reads metrics"| node_metadata
node_app -->|"displays"| node_analysis
node_analysis -->|"reads datasets"| node_raw
node_analysis -->|"reads datasets"| node_processed
node_runner -->|"runs step"| node_download
node_runner -->|"runs step"| node_eda
node_runner -->|"runs step"| node_preprocess
node_runner -->|"runs step"| node_train
node_runner -->|"runs step"| node_storage
node_download -->|"fetches data"| node_providers
node_download -->|"writes datasets"| node_raw
node_eda -->|"reads datasets"| node_raw
node_eda -->|"writes analysis"| node_explore_outputs
node_preprocess -->|"reads datasets"| node_raw
node_preprocess -->|"writes datasets"| node_processed
node_train -->|"reads datasets"| node_processed
node_train -->|"returns results"| node_storage
node_storage -->|"writes models"| node_models
node_storage -->|"writes scalers"| node_scalers
node_storage -->|"writes metrics"| node_metadata

click node_app "https://github.com/tigertim/hippomedica/blob/main/web_app/app.py"
click node_input "https://github.com/tigertim/hippomedica/blob/main/web_app/app.py"
click node_predict "https://github.com/tigertim/hippomedica/blob/main/web_app/app.py"
click node_explain "https://github.com/tigertim/hippomedica/blob/main/web_app/app.py"
click node_performance "https://github.com/tigertim/hippomedica/blob/main/web_app/app.py"
click node_analysis "https://github.com/tigertim/hippomedica/blob/main/web_app/app.py"
click node_runner "https://github.com/tigertim/hippomedica/blob/main/pipeline/run_pipeline.py"
click node_download "https://github.com/tigertim/hippomedica/blob/main/pipeline/01_data_download.py"
click node_eda "https://github.com/tigertim/hippomedica/blob/main/pipeline/02_exploratory_analysis.py"
click node_preprocess "https://github.com/tigertim/hippomedica/blob/main/pipeline/03_preprocessing.py"
click node_train "https://github.com/tigertim/hippomedica/blob/main/pipeline/04_model_training.py"
click node_storage "https://github.com/tigertim/hippomedica/blob/main/pipeline/05_model_storage.py"
click node_raw "https://github.com/tigertim/hippomedica/tree/main/datasets/raw"
click node_processed "https://github.com/tigertim/hippomedica/tree/main/datasets/processed"
click node_explore_outputs "https://github.com/tigertim/hippomedica/tree/main/pipeline/outputs/visualizations"
click node_models "https://github.com/tigertim/hippomedica/tree/main/models/trained_models"
click node_scalers "https://github.com/tigertim/hippomedica/tree/main/models/scalers"
click node_metadata "https://github.com/tigertim/hippomedica/tree/main/models/metadata"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_input,node_predict,node_explain,node_performance,node_analysis,node_person toneBlue
class node_runner,node_download,node_eda,node_preprocess,node_train,node_storage toneAmber
class node_raw,node_processed,node_explore_outputs toneMint
class node_models,node_scalers,node_metadata toneRose
class node_providers toneIndigo
```

## Components

### Risk Assessment App

- [Streamlit Interface](https://github.com/tigertim/hippomedica/blob/main/web_app/app.py): `web_app/app.py`
- [Health Inputs](https://github.com/tigertim/hippomedica/blob/main/web_app/app.py): `web_app/app.py`
- [Risk Prediction](https://github.com/tigertim/hippomedica/blob/main/web_app/app.py): `web_app/app.py`
- [Results & Explanations](https://github.com/tigertim/hippomedica/blob/main/web_app/app.py): `web_app/app.py`
- [Performance View](https://github.com/tigertim/hippomedica/blob/main/web_app/app.py): `web_app/app.py`
- [Data Analysis View](https://github.com/tigertim/hippomedica/blob/main/web_app/app.py): `web_app/app.py`

### Training Pipeline

- [Pipeline Orchestrator](https://github.com/tigertim/hippomedica/blob/main/pipeline/run_pipeline.py): `pipeline/run_pipeline.py`
- [Dataset Download](https://github.com/tigertim/hippomedica/blob/main/pipeline/01_data_download.py): `pipeline/01_data_download.py`
- [Exploratory Analysis](https://github.com/tigertim/hippomedica/blob/main/pipeline/02_exploratory_analysis.py): `pipeline/02_exploratory_analysis.py`
- [Data Preprocessing](https://github.com/tigertim/hippomedica/blob/main/pipeline/03_preprocessing.py): `pipeline/03_preprocessing.py`
- [Model Training](https://github.com/tigertim/hippomedica/blob/main/pipeline/04_model_training.py): `pipeline/04_model_training.py`
- [Model Storage](https://github.com/tigertim/hippomedica/blob/main/pipeline/05_model_storage.py): `pipeline/05_model_storage.py`

### Disease Data

- [Raw Datasets](https://github.com/tigertim/hippomedica/tree/main/datasets/raw): `datasets/raw`
- [Processed Datasets](https://github.com/tigertim/hippomedica/tree/main/datasets/processed): `datasets/processed`
- [EDA Outputs](https://github.com/tigertim/hippomedica/tree/main/pipeline/outputs/visualizations): `pipeline/outputs/visualizations`

### Model Artifacts

- [Trained Models](https://github.com/tigertim/hippomedica/tree/main/models/trained_models): `models/trained_models`
- [Scalers & Features](https://github.com/tigertim/hippomedica/tree/main/models/scalers): `models/scalers`
- [Metrics & Importance](https://github.com/tigertim/hippomedica/tree/main/models/metadata): `models/metadata`

### Other components

- **App User**
- **Dataset Providers**

## Connections

- App User → Streamlit Interface: uses
- Streamlit Interface → Health Inputs: collects
- Health Inputs → Risk Prediction: submits
- Risk Prediction → Trained Models: loads models
- Risk Prediction → Scalers & Features: loads scaling data
- Risk Prediction → Results & Explanations: returns predictions
- Streamlit Interface → Performance View: displays
- Performance View → Metrics & Importance: reads metrics
- Streamlit Interface → Data Analysis View: displays
- Data Analysis View → Raw Datasets: reads datasets
- Data Analysis View → Processed Datasets: reads datasets
- Pipeline Orchestrator → Dataset Download: runs step
- Pipeline Orchestrator → Exploratory Analysis: runs step
- Pipeline Orchestrator → Data Preprocessing: runs step
- Pipeline Orchestrator → Model Training: runs step
- Pipeline Orchestrator → Model Storage: runs step
- Dataset Download → Dataset Providers: fetches data
- Dataset Download → Raw Datasets: writes datasets
- Exploratory Analysis → Raw Datasets: reads datasets
- Exploratory Analysis → EDA Outputs: writes analysis
- Data Preprocessing → Raw Datasets: reads datasets
- Data Preprocessing → Processed Datasets: writes datasets
- Model Training → Processed Datasets: reads datasets
- Model Training → Model Storage: returns results
- Model Storage → Trained Models: writes models
- Model Storage → Scalers & Features: writes scalers
- Model Storage → Metrics & Importance: writes metrics
