# keysarenull/prediction architecture

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

- Interactive diagram: https://gitdiagram.com/keysarenull/prediction
- Repository: https://github.com/keysarenull/prediction

## Overview

This is a Streamlit heart-disease prediction app. Users enter health indicators, request a prediction, and see an ensemble result with confidence, disagreement warnings, and individual model outputs. The sampled code shows the UI-to-ensemble calls and model loading and prediction; README content was not available to verify additional capabilities.

Main entry points: [`utils/predictor.py`](https://github.com/keysarenull/prediction/blob/main/utils/predictor.py) (Ensemble predictor), [`app.py`](https://github.com/keysarenull/prediction/blob/main/app.py) (Input and results UI), [`model/logistic_regression_heart_disease_model.joblib`](https://github.com/keysarenull/prediction/blob/main/model/logistic_regression_heart_disease_model.joblib) (Logistic regression), [`model/random_forest_heart_disease_model.joblib`](https://github.com/keysarenull/prediction/blob/main/model/random_forest_heart_disease_model.joblib) (Random forest)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["User interface"]
  node_app["Input and results UI<br/>[app.py]"]
end

subgraph group_prediction["Prediction engine"]
  node_predictor["Ensemble predictor<br/>[predictor.py]"]
  node_logistic["Logistic regression"]
  node_forest["Random forest"]
  node_gradient["Gradient boosting"]
  node_xgboost["XGBoost"]
end

node_user(("User"))

node_user -->|"enters health data"| node_app
node_app -->|"requests prediction"| node_predictor
node_predictor -->|"loads and predicts"| node_logistic
node_predictor -->|"loads and predicts"| node_forest
node_predictor -->|"loads and predicts"| node_gradient
node_predictor -->|"loads and predicts"| node_xgboost
node_predictor -->|"returns ensemble result"| node_app

click node_app "https://github.com/keysarenull/prediction/blob/main/app.py"
click node_predictor "https://github.com/keysarenull/prediction/blob/main/utils/predictor.py"
click node_logistic "https://github.com/keysarenull/prediction/blob/main/model/logistic_regression_heart_disease_model.joblib"
click node_forest "https://github.com/keysarenull/prediction/blob/main/model/random_forest_heart_disease_model.joblib"
click node_gradient "https://github.com/keysarenull/prediction/blob/main/model/gradient_boosting_heart_disease_model.joblib"
click node_xgboost "https://github.com/keysarenull/prediction/blob/main/model/xgboost_heart_disease_model.joblib"

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_user toneBlue
class node_predictor,node_logistic,node_forest,node_gradient,node_xgboost toneAmber
```

## Components

### User interface

- [Input and results UI](https://github.com/keysarenull/prediction/blob/main/app.py): `app.py`

### Prediction engine

- [Ensemble predictor](https://github.com/keysarenull/prediction/blob/main/utils/predictor.py): `utils/predictor.py`
- [Logistic regression](https://github.com/keysarenull/prediction/blob/main/model/logistic_regression_heart_disease_model.joblib): `model/logistic_regression_heart_disease_model.joblib`
- [Random forest](https://github.com/keysarenull/prediction/blob/main/model/random_forest_heart_disease_model.joblib): `model/random_forest_heart_disease_model.joblib`
- [Gradient boosting](https://github.com/keysarenull/prediction/blob/main/model/gradient_boosting_heart_disease_model.joblib): `model/gradient_boosting_heart_disease_model.joblib`
- [XGBoost](https://github.com/keysarenull/prediction/blob/main/model/xgboost_heart_disease_model.joblib): `model/xgboost_heart_disease_model.joblib`

### Other components

- **User**

## Connections

- User → Input and results UI: enters health data
- Input and results UI → Ensemble predictor: requests prediction
- Ensemble predictor → Logistic regression: loads and predicts
- Ensemble predictor → Random forest: loads and predicts
- Ensemble predictor → Gradient boosting: loads and predicts
- Ensemble predictor → XGBoost: loads and predicts
- Ensemble predictor → Input and results UI: returns ensemble result
