# yedz18/health_predicion architecture

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

- Interactive diagram: https://gitdiagram.com/yedz18/health_predicion
- Repository: https://github.com/yedz18/health_predicion

## Overview

This repository is a web-based stroke-risk prediction application. A user submits health and demographic fields; the FastAPI handler encodes categorical values, scales the feature row, runs a persisted classifier, and renders a risk message. The tree and sampled app.py support this runtime path, but the README is empty and the template contents were not sampled, so presentation wiring beyond the handler’s template use is not inferred.

Main entry points: [`Health-Prediction-main/Brain-Stoke-Prediction-main/app.py`](https://github.com/yedz18/health_predicion/blob/main/Health-Prediction-main/Brain-Stoke-Prediction-main/app.py) (FastAPI app), [`Health-Prediction-main/Brain-Stoke-Prediction-main/templates/index.html`](https://github.com/yedz18/health_predicion/blob/main/Health-Prediction-main/Brain-Stoke-Prediction-main/templates/index.html) (Input form), [`Health-Prediction-main/Brain-Stoke-Prediction-main/scaler.pkl`](https://github.com/yedz18/health_predicion/blob/main/Health-Prediction-main/Brain-Stoke-Prediction-main/scaler.pkl) (Feature scaler), [`Health-Prediction-main/Brain-Stoke-Prediction-main/stoke_prediction.pkl`](https://github.com/yedz18/health_predicion/blob/main/Health-Prediction-main/Brain-Stoke-Prediction-main/stoke_prediction.pkl) (Stroke classifier)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["Web presentation"]
  node_form["Input form<br/>[index.html]"]
  node_result["Prediction message<br/>[index.html]"]
  node_styles["Page styles<br/>[style.css]"]
end

subgraph group_prediction["Prediction runtime"]
  node_app["FastAPI app<br/>[app.py]"]
  node_encoding["Feature encoding<br/>[app.py]"]
end

subgraph group_artifacts["Model artifacts"]
  node_scaler["Feature scaler<br/>[scaler.pkl]"]
  node_classifier["Stroke classifier"]
end

node_user(("User"))

node_user -->|"enters health data"| node_form
node_form -->|"submits form"| node_app
node_app -->|"encodes fields"| node_encoding
node_app -->|"loads at startup"| node_scaler
node_app -->|"loads at startup"| node_classifier
node_app -->|"scales features"| node_scaler
node_app -->|"predicts risk"| node_classifier
node_app -->|"renders message"| node_result
node_app -->|"renders page"| node_form
node_user -->|"reads result"| node_result
node_app -->|"mounts static files"| node_styles

click node_form "https://github.com/yedz18/health_predicion/blob/main/Health-Prediction-main/Brain-Stoke-Prediction-main/templates/index.html"
click node_app "https://github.com/yedz18/health_predicion/blob/main/Health-Prediction-main/Brain-Stoke-Prediction-main/app.py"
click node_encoding "https://github.com/yedz18/health_predicion/blob/main/Health-Prediction-main/Brain-Stoke-Prediction-main/app.py"
click node_scaler "https://github.com/yedz18/health_predicion/blob/main/Health-Prediction-main/Brain-Stoke-Prediction-main/scaler.pkl"
click node_classifier "https://github.com/yedz18/health_predicion/blob/main/Health-Prediction-main/Brain-Stoke-Prediction-main/stoke_prediction.pkl"
click node_result "https://github.com/yedz18/health_predicion/blob/main/Health-Prediction-main/Brain-Stoke-Prediction-main/templates/index.html"
click node_styles "https://github.com/yedz18/health_predicion/blob/main/Health-Prediction-main/Brain-Stoke-Prediction-main/static/style.css"

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_form,node_result,node_styles,node_user toneBlue
class node_app,node_encoding toneAmber
class node_scaler,node_classifier toneMint
```

## Components

### Web presentation

- [Input form](https://github.com/yedz18/health_predicion/blob/main/Health-Prediction-main/Brain-Stoke-Prediction-main/templates/index.html): `Health-Prediction-main/Brain-Stoke-Prediction-main/templates/index.html`
- [Prediction message](https://github.com/yedz18/health_predicion/blob/main/Health-Prediction-main/Brain-Stoke-Prediction-main/templates/index.html): `Health-Prediction-main/Brain-Stoke-Prediction-main/templates/index.html`
- [Page styles](https://github.com/yedz18/health_predicion/blob/main/Health-Prediction-main/Brain-Stoke-Prediction-main/static/style.css): `Health-Prediction-main/Brain-Stoke-Prediction-main/static/style.css`

### Prediction runtime

- [FastAPI app](https://github.com/yedz18/health_predicion/blob/main/Health-Prediction-main/Brain-Stoke-Prediction-main/app.py): `Health-Prediction-main/Brain-Stoke-Prediction-main/app.py`
- [Feature encoding](https://github.com/yedz18/health_predicion/blob/main/Health-Prediction-main/Brain-Stoke-Prediction-main/app.py): `Health-Prediction-main/Brain-Stoke-Prediction-main/app.py`

### Model artifacts

- [Feature scaler](https://github.com/yedz18/health_predicion/blob/main/Health-Prediction-main/Brain-Stoke-Prediction-main/scaler.pkl): `Health-Prediction-main/Brain-Stoke-Prediction-main/scaler.pkl`
- [Stroke classifier](https://github.com/yedz18/health_predicion/blob/main/Health-Prediction-main/Brain-Stoke-Prediction-main/stoke_prediction.pkl): `Health-Prediction-main/Brain-Stoke-Prediction-main/stoke_prediction.pkl`

### Other components

- **User**

## Connections

- User → Input form: enters health data
- Input form → FastAPI app: submits form
- FastAPI app → Feature encoding: encodes fields
- FastAPI app → Feature scaler: loads at startup
- FastAPI app → Stroke classifier: loads at startup
- FastAPI app → Feature scaler: scales features
- FastAPI app → Stroke classifier: predicts risk
- FastAPI app → Prediction message: renders message
- FastAPI app → Input form: renders page
- User → Prediction message: reads result
- FastAPI app → Page styles: mounts static files
