# soumajit11/insight-ml architecture

> Architecture diagram of the GitHub repository soumajit11/insight-ml, 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/soumajit11/insight-ml
- Repository: https://github.com/soumajit11/insight-ml

## Overview

This is a Flask-based AutoML web application. Users upload a CSV or Excel dataset, inspect a secure preview and automated EDA, configure a target and split, compare trained models, then review metrics and feature importance or export results and a model package. The graph reflects documented capabilities and sampled call paths; some route and export wiring is described in the README but not visible in the supplied source excerpts.

Main entry points: [`model_utils.py`](https://github.com/soumajit11/insight-ml/blob/main/model_utils.py) (ML facade), [`app.py`](https://github.com/soumajit11/insight-ml/blob/main/app.py) (Flask routes), [`app_helpers.py`](https://github.com/soumajit11/insight-ml/blob/main/app_helpers.py) (Request and session helpers), [`static/app.js`](https://github.com/soumajit11/insight-ml/blob/main/static/app.js) (Browser UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_browser["Browser UI<br/>[app.js]"]
  node_templates["Page templates"]
  node_flask["Flask routes<br/>[app.py]"]
end

subgraph group_ingest["Dataset workflow"]
  node_helpers["Request and session helpers<br/>[app_helpers.py]"]
  node_dataset["Uploaded dataset"]
  node_sessioncache["Session cache<br/>[app_helpers.py]"]
  node_preview["Safe preview rendering<br/>[config.py]"]
end

subgraph group_analysis["Analysis and training"]
  node_facade["ML facade<br/>[model_utils.py]"]
  node_validation["Validation and target detection<br/>[utils.py]"]
  node_eda["Exploratory analysis<br/>[eda.py]"]
  node_config["Training configuration<br/>[config.py]"]
  node_preprocessing["Feature preprocessing<br/>[preprocessing.py]"]
  node_models["Model comparison<br/>[models.py]"]
end

subgraph group_results["Results and export"]
  node_results["Metrics and importance<br/>[models.py]"]
  node_export["Model and results export<br/>[app.py]"]
  node_archive["Downloadable model package"]
end

node_user(("User"))

node_user -->|"uses"| node_browser
node_templates -->|"renders"| node_browser
node_browser -->|"sends requests"| node_flask
node_flask -->|"dispatches"| node_helpers
node_helpers -->|"validates and loads"| node_dataset
node_helpers -->|"caches session data"| node_sessioncache
node_helpers -->|"requests analysis and training"| node_facade
node_flask -->|"requests target analysis"| node_facade
node_facade -->|"validates and detects"| node_validation
node_facade -->|"computes EDA"| node_eda
node_facade -->|"builds preview"| node_preview
node_facade -->|"creates training config"| node_config
node_facade -->|"runs comparison"| node_models
node_models -->|"uses pipelines"| node_preprocessing
node_models -->|"produces"| node_results
node_helpers -->|"stores training results"| node_sessioncache
node_flask -->|"reads cached results"| node_sessioncache
node_flask -->|"handles export requests"| node_export
node_export -->|"streams model package"| node_archive
node_export -->|"returns downloads"| node_browser
node_flask -->|"returns API results"| node_browser

click node_browser "https://github.com/soumajit11/insight-ml/blob/main/static/app.js"
click node_templates "https://github.com/soumajit11/insight-ml/tree/main/templates"
click node_flask "https://github.com/soumajit11/insight-ml/blob/main/app.py"
click node_helpers "https://github.com/soumajit11/insight-ml/blob/main/app_helpers.py"
click node_sessioncache "https://github.com/soumajit11/insight-ml/blob/main/app_helpers.py"
click node_facade "https://github.com/soumajit11/insight-ml/blob/main/model_utils.py"
click node_validation "https://github.com/soumajit11/insight-ml/blob/main/ml_utils/utils.py"
click node_eda "https://github.com/soumajit11/insight-ml/blob/main/ml_utils/eda.py"
click node_config "https://github.com/soumajit11/insight-ml/blob/main/ml_utils/config.py"
click node_preprocessing "https://github.com/soumajit11/insight-ml/blob/main/ml_utils/preprocessing.py"
click node_models "https://github.com/soumajit11/insight-ml/blob/main/ml_utils/models.py"
click node_results "https://github.com/soumajit11/insight-ml/blob/main/ml_utils/models.py"
click node_preview "https://github.com/soumajit11/insight-ml/blob/main/ml_utils/config.py"
click node_export "https://github.com/soumajit11/insight-ml/blob/main/app.py"

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_browser,node_templates,node_flask,node_user toneBlue
class node_helpers,node_dataset,node_sessioncache,node_preview toneAmber
class node_facade,node_validation,node_eda,node_config,node_preprocessing,node_models toneMint
class node_results,node_export,node_archive toneRose
```

## Components

### Web experience

- [Browser UI](https://github.com/soumajit11/insight-ml/blob/main/static/app.js): `static/app.js`
- [Page templates](https://github.com/soumajit11/insight-ml/tree/main/templates): `templates`
- [Flask routes](https://github.com/soumajit11/insight-ml/blob/main/app.py): `app.py`

### Dataset workflow

- [Request and session helpers](https://github.com/soumajit11/insight-ml/blob/main/app_helpers.py): `app_helpers.py`
- **Uploaded dataset**
- [Session cache](https://github.com/soumajit11/insight-ml/blob/main/app_helpers.py): `app_helpers.py`
- [Safe preview rendering](https://github.com/soumajit11/insight-ml/blob/main/ml_utils/config.py): `ml_utils/config.py`

### Analysis and training

- [ML facade](https://github.com/soumajit11/insight-ml/blob/main/model_utils.py): `model_utils.py`
- [Validation and target detection](https://github.com/soumajit11/insight-ml/blob/main/ml_utils/utils.py): `ml_utils/utils.py`
- [Exploratory analysis](https://github.com/soumajit11/insight-ml/blob/main/ml_utils/eda.py): `ml_utils/eda.py`
- [Training configuration](https://github.com/soumajit11/insight-ml/blob/main/ml_utils/config.py): `ml_utils/config.py`
- [Feature preprocessing](https://github.com/soumajit11/insight-ml/blob/main/ml_utils/preprocessing.py): `ml_utils/preprocessing.py`
- [Model comparison](https://github.com/soumajit11/insight-ml/blob/main/ml_utils/models.py): `ml_utils/models.py`

### Results and export

- [Metrics and importance](https://github.com/soumajit11/insight-ml/blob/main/ml_utils/models.py): `ml_utils/models.py`
- [Model and results export](https://github.com/soumajit11/insight-ml/blob/main/app.py): `app.py`
- **Downloadable model package**

### Other components

- **User**

## Connections

- User → Browser UI: uses
- Page templates → Browser UI: renders
- Browser UI → Flask routes: sends requests
- Flask routes → Request and session helpers: dispatches
- Request and session helpers → Uploaded dataset: validates and loads
- Request and session helpers → Session cache: caches session data
- Request and session helpers → ML facade: requests analysis and training
- Flask routes → ML facade: requests target analysis
- ML facade → Validation and target detection: validates and detects
- ML facade → Exploratory analysis: computes EDA
- ML facade → Safe preview rendering: builds preview
- ML facade → Training configuration: creates training config
- ML facade → Model comparison: runs comparison
- Model comparison → Feature preprocessing: uses pipelines
- Model comparison → Metrics and importance: produces
- Request and session helpers → Session cache: stores training results
- Flask routes → Session cache: reads cached results
- Flask routes → Model and results export: handles export requests
- Model and results export → Downloadable model package: streams model package
- Model and results export → Browser UI: returns downloads
- Flask routes → Browser UI: returns API results
