# karangarje48-lab/mediclaim-app architecture

> Architecture diagram of the GitHub repository karangarje48-lab/mediclaim-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/karangarje48-lab/mediclaim-app
- Repository: https://github.com/karangarje48-lab/mediclaim-app

## Overview

This is a Streamlit insurance-charge prediction app. Users enter a profile for a single estimate or upload a CSV for batch predictions; the app loads and cleans the bundled dataset, loads a trained Random Forest pipeline, and displays predictions. Separate views provide data exploration, exploratory analysis, and model-performance metrics. The map follows the sampled app implementation and README; training details are documented as notebook work, but notebook source was not sampled, so its internal steps are not expanded.

Main entry points: [`app.py`](https://github.com/karangarje48-lab/mediclaim-app/blob/main/app.py) (Streamlit App), [`model/insurance_model_pipeline.pkl`](https://github.com/karangarje48-lab/mediclaim-app/blob/main/model/insurance_model_pipeline.pkl) (Trained Pipeline), [`mediclaim_raw.csv`](https://github.com/karangarje48-lab/mediclaim-app/blob/main/mediclaim_raw.csv) (Insurance Dataset), [`Mediclaim.ipynb`](https://github.com/karangarje48-lab/mediclaim-app/blob/main/Mediclaim.ipynb) (Training and EDA)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Data and Model Inputs"]
  node_dataset["Insurance Dataset<br/>[mediclaim_raw.csv]"]
  node_model["Trained Pipeline"]
  node_notebook["Training and EDA<br/>[Mediclaim.ipynb]"]
end

subgraph group_runtime["Prediction Runtime"]
  node_streamlit["Streamlit App<br/>[app.py]"]
  node_cleaning["Data Cleaning<br/>[app.py]"]
  node_prediction["Charge Prediction<br/>[app.py]"]
  node_batch["Batch Prediction<br/>[app.py]"]
end

subgraph group_insights["Analysis Views"]
  node_explorer["Data Explorer<br/>[app.py]"]
  node_eda["EDA Dashboard<br/>[app.py]"]
  node_performance["Model Performance<br/>[app.py]"]
end

node_user(("App User"))

node_user -->|"uses"| node_streamlit
node_streamlit -->|"loads"| node_dataset
node_streamlit -->|"loads"| node_model
node_streamlit -->|"cleans data"| node_cleaning
node_streamlit -->|"routes input"| node_prediction
node_streamlit -->|"routes upload"| node_batch
node_streamlit -->|"routes view"| node_explorer
node_streamlit -->|"routes view"| node_eda
node_streamlit -->|"routes view"| node_performance
node_prediction -->|"predicts with"| node_model
node_batch -->|"cleans upload"| node_cleaning
node_batch -->|"predicts with"| node_model
node_explorer -->|"displays data"| node_dataset
node_eda -->|"analyzes data"| node_dataset
node_performance -->|"evaluates"| node_model
node_notebook -.->|"trains pipeline"| node_model

click node_streamlit "https://github.com/karangarje48-lab/mediclaim-app/blob/main/app.py"
click node_cleaning "https://github.com/karangarje48-lab/mediclaim-app/blob/main/app.py"
click node_dataset "https://github.com/karangarje48-lab/mediclaim-app/blob/main/mediclaim_raw.csv"
click node_model "https://github.com/karangarje48-lab/mediclaim-app/blob/main/model/insurance_model_pipeline.pkl"
click node_prediction "https://github.com/karangarje48-lab/mediclaim-app/blob/main/app.py"
click node_batch "https://github.com/karangarje48-lab/mediclaim-app/blob/main/app.py"
click node_explorer "https://github.com/karangarje48-lab/mediclaim-app/blob/main/app.py"
click node_eda "https://github.com/karangarje48-lab/mediclaim-app/blob/main/app.py"
click node_performance "https://github.com/karangarje48-lab/mediclaim-app/blob/main/app.py"
click node_notebook "https://github.com/karangarje48-lab/mediclaim-app/blob/main/Mediclaim.ipynb"

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_dataset,node_model,node_notebook,node_user toneBlue
class node_streamlit,node_cleaning,node_prediction,node_batch toneAmber
class node_explorer,node_eda,node_performance toneMint
```

## Components

### Data and Model Inputs

- [Insurance Dataset](https://github.com/karangarje48-lab/mediclaim-app/blob/main/mediclaim_raw.csv): `mediclaim_raw.csv`
- [Trained Pipeline](https://github.com/karangarje48-lab/mediclaim-app/blob/main/model/insurance_model_pipeline.pkl): `model/insurance_model_pipeline.pkl`
- [Training and EDA](https://github.com/karangarje48-lab/mediclaim-app/blob/main/Mediclaim.ipynb): `Mediclaim.ipynb`

### Prediction Runtime

- [Streamlit App](https://github.com/karangarje48-lab/mediclaim-app/blob/main/app.py): `app.py`
- [Data Cleaning](https://github.com/karangarje48-lab/mediclaim-app/blob/main/app.py): `app.py`
- [Charge Prediction](https://github.com/karangarje48-lab/mediclaim-app/blob/main/app.py): `app.py`
- [Batch Prediction](https://github.com/karangarje48-lab/mediclaim-app/blob/main/app.py): `app.py`

### Analysis Views

- [Data Explorer](https://github.com/karangarje48-lab/mediclaim-app/blob/main/app.py): `app.py`
- [EDA Dashboard](https://github.com/karangarje48-lab/mediclaim-app/blob/main/app.py): `app.py`
- [Model Performance](https://github.com/karangarje48-lab/mediclaim-app/blob/main/app.py): `app.py`

### Other components

- **App User**

## Connections

- App User → Streamlit App: uses (evidence: `README.md`)
- Streamlit App → Insurance Dataset: loads (evidence: `app.py`)
- Streamlit App → Trained Pipeline: loads (evidence: `app.py`)
- Streamlit App → Data Cleaning: cleans data (evidence: `app.py`)
- Streamlit App → Charge Prediction: routes input (evidence: `app.py`)
- Streamlit App → Batch Prediction: routes upload (evidence: `app.py`)
- Streamlit App → Data Explorer: routes view (evidence: `app.py`)
- Streamlit App → EDA Dashboard: routes view (evidence: `app.py`)
- Streamlit App → Model Performance: routes view (evidence: `app.py`)
- Charge Prediction → Trained Pipeline: predicts with (evidence: `app.py`)
- Batch Prediction → Data Cleaning: cleans upload (evidence: `app.py`)
- Batch Prediction → Trained Pipeline: predicts with (evidence: `app.py`)
- Data Explorer → Insurance Dataset: displays data (evidence: `app.py`)
- EDA Dashboard → Insurance Dataset: analyzes data (evidence: `app.py`)
- Model Performance → Trained Pipeline: evaluates (evidence: `app.py`)
- Training and EDA → Trained Pipeline: trains pipeline (evidence: `README.md`)
