# seyed-hesam-hojjat/predef-ml architecture

> Architecture diagram of the GitHub repository seyed-hesam-hojjat/predef-ml, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/seyed-hesam-hojjat/predef-ml
- Repository: https://github.com/seyed-hesam-hojjat/predef-ml

## Overview

Tabular ML Workbench is a local Streamlit application that guides users from tabular-file upload through data review, feature preparation, validation-aware model selection, held-out evaluation, and downloadable reports or a fitted predictor. README documents spreadsheet and CSV import, audit checks, split strategies, preprocessing, algorithm families, and export features. The main ownership edges are supported by app.py imports and excerpts; module internals support preprocessing and prediction behavior. Some UI and modeling calls are omitted from excerpts, so those links rely on explicit README descriptions where applicable.

Main entry points: [`app.py`](https://github.com/seyed-hesam-hojjat/predef-ml/blob/main/app.py) (Streamlit workbench), [`ml_workbench/inference.py`](https://github.com/seyed-hesam-hojjat/predef-ml/blob/main/ml_workbench/inference.py) (Raw-input predictor), [`ml_workbench/modeling.py`](https://github.com/seyed-hesam-hojjat/predef-ml/blob/main/ml_workbench/modeling.py) (Model comparison), [`ml_workbench/preprocessing.py`](https://github.com/seyed-hesam-hojjat/predef-ml/blob/main/ml_workbench/preprocessing.py) (Prediction preparation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Guided workflow"]
  node_app["Streamlit workbench<br/>[app.py]"]
  node_fileinput["CSV / Excel input"]
  node_task["Target and task<br/>[app.py]"]
end

subgraph group_analysis["Data and modeling"]
  node_audit["Quality audit<br/>[audit.py]"]
  node_prepare["Feature preparation<br/>[preprocessing.py]"]
  node_split["Holdout splitting<br/>[modeling.py]"]
  node_preprocessor["Fold preprocessing<br/>[preprocessing.py]"]
  node_benchmark["Model comparison<br/>[modeling.py]"]
  node_tuning["Hyperparameter search<br/>[modeling.py]"]
  node_evaluation["Holdout evaluation<br/>[modeling.py]"]
  node_importance["Permutation importance<br/>[modeling.py]"]
  node_predictionprep["Prediction preparation<br/>[preprocessing.py]"]
end

subgraph group_outputs["Results and reuse"]
  node_predictor["Raw-input predictor<br/>[inference.py]"]
  node_report["Excel report<br/>[reporting.py]"]
  node_artifact["Serialized model<br/>[reporting.py]"]
end

node_user(("Analyst"))
node_newdata["New tabular rows"]

node_user -->|"operates"| node_app
node_fileinput -->|"uploads"| node_app
node_app -->|"audits"| node_audit
node_app -->|"confirms"| node_task
node_app -->|"prepares"| node_prepare
node_app -->|"requests split"| node_split
node_app -->|"benchmarks"| node_benchmark
node_benchmark -.->|"fits folds"| node_preprocessor
node_benchmark -->|"tunes finalists"| node_tuning
node_app -->|"evaluates holdout"| node_evaluation
node_evaluation -->|"computes importance"| node_importance
node_app -->|"exports report"| node_report
node_app -->|"builds predictor"| node_predictor
node_predictor -->|"prepares inputs"| node_predictionprep
node_predictionprep -.->|"returns features"| node_preprocessor
node_app -->|"serializes model"| node_artifact
node_user -.->|"provides rows"| node_newdata
node_newdata -.->|"requests predictions"| node_predictor
node_predictor -.->|"returns predictions"| node_user
node_report -->|"downloads"| node_user
node_artifact -->|"downloads"| node_user

click node_app "https://github.com/seyed-hesam-hojjat/predef-ml/blob/main/app.py"
click node_audit "https://github.com/seyed-hesam-hojjat/predef-ml/blob/main/ml_workbench/audit.py"
click node_task "https://github.com/seyed-hesam-hojjat/predef-ml/blob/main/app.py"
click node_prepare "https://github.com/seyed-hesam-hojjat/predef-ml/blob/main/ml_workbench/preprocessing.py"
click node_split "https://github.com/seyed-hesam-hojjat/predef-ml/blob/main/ml_workbench/modeling.py"
click node_preprocessor "https://github.com/seyed-hesam-hojjat/predef-ml/blob/main/ml_workbench/preprocessing.py"
click node_benchmark "https://github.com/seyed-hesam-hojjat/predef-ml/blob/main/ml_workbench/modeling.py"
click node_tuning "https://github.com/seyed-hesam-hojjat/predef-ml/blob/main/ml_workbench/modeling.py"
click node_evaluation "https://github.com/seyed-hesam-hojjat/predef-ml/blob/main/ml_workbench/modeling.py"
click node_importance "https://github.com/seyed-hesam-hojjat/predef-ml/blob/main/ml_workbench/modeling.py"
click node_predictor "https://github.com/seyed-hesam-hojjat/predef-ml/blob/main/ml_workbench/inference.py"
click node_predictionprep "https://github.com/seyed-hesam-hojjat/predef-ml/blob/main/ml_workbench/preprocessing.py"
click node_report "https://github.com/seyed-hesam-hojjat/predef-ml/blob/main/ml_workbench/reporting.py"
click node_artifact "https://github.com/seyed-hesam-hojjat/predef-ml/blob/main/ml_workbench/reporting.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_app,node_fileinput,node_task toneBlue
class node_audit,node_prepare,node_split,node_preprocessor,node_benchmark,node_tuning,node_evaluation,node_importance,node_predictionprep toneAmber
class node_predictor,node_report,node_artifact toneMint
class node_user,node_newdata toneIndigo
```

## Components

### Guided workflow

- [Streamlit workbench](https://github.com/seyed-hesam-hojjat/predef-ml/blob/main/app.py): `app.py`
- **CSV / Excel input**
- [Target and task](https://github.com/seyed-hesam-hojjat/predef-ml/blob/main/app.py): `app.py`

### Data and modeling

- [Quality audit](https://github.com/seyed-hesam-hojjat/predef-ml/blob/main/ml_workbench/audit.py): `ml_workbench/audit.py`
- [Feature preparation](https://github.com/seyed-hesam-hojjat/predef-ml/blob/main/ml_workbench/preprocessing.py): `ml_workbench/preprocessing.py`
- [Holdout splitting](https://github.com/seyed-hesam-hojjat/predef-ml/blob/main/ml_workbench/modeling.py): `ml_workbench/modeling.py`
- [Fold preprocessing](https://github.com/seyed-hesam-hojjat/predef-ml/blob/main/ml_workbench/preprocessing.py): `ml_workbench/preprocessing.py`
- [Model comparison](https://github.com/seyed-hesam-hojjat/predef-ml/blob/main/ml_workbench/modeling.py): `ml_workbench/modeling.py`
- [Hyperparameter search](https://github.com/seyed-hesam-hojjat/predef-ml/blob/main/ml_workbench/modeling.py): `ml_workbench/modeling.py`
- [Holdout evaluation](https://github.com/seyed-hesam-hojjat/predef-ml/blob/main/ml_workbench/modeling.py): `ml_workbench/modeling.py`
- [Permutation importance](https://github.com/seyed-hesam-hojjat/predef-ml/blob/main/ml_workbench/modeling.py): `ml_workbench/modeling.py`
- [Prediction preparation](https://github.com/seyed-hesam-hojjat/predef-ml/blob/main/ml_workbench/preprocessing.py): `ml_workbench/preprocessing.py`

### Results and reuse

- [Raw-input predictor](https://github.com/seyed-hesam-hojjat/predef-ml/blob/main/ml_workbench/inference.py): `ml_workbench/inference.py`
- [Excel report](https://github.com/seyed-hesam-hojjat/predef-ml/blob/main/ml_workbench/reporting.py): `ml_workbench/reporting.py`
- [Serialized model](https://github.com/seyed-hesam-hojjat/predef-ml/blob/main/ml_workbench/reporting.py): `ml_workbench/reporting.py`

### Other components

- **Analyst**
- **New tabular rows**

## Connections

- Analyst → Streamlit workbench: operates (evidence: `README.md`)
- CSV / Excel input → Streamlit workbench: uploads (evidence: `README.md`)
- Streamlit workbench → Quality audit: audits (evidence: `app.py`)
- Streamlit workbench → Target and task: confirms (evidence: `README.md`)
- Streamlit workbench → Feature preparation: prepares (evidence: `app.py`)
- Streamlit workbench → Holdout splitting: requests split (evidence: `app.py`)
- Streamlit workbench → Model comparison: benchmarks (evidence: `app.py`)
- Model comparison → Fold preprocessing: fits folds (evidence: `ml_workbench/modeling.py`)
- Model comparison → Hyperparameter search: tunes finalists (evidence: `README.md`)
- Streamlit workbench → Holdout evaluation: evaluates holdout (evidence: `README.md`)
- Holdout evaluation → Permutation importance: computes importance (evidence: `README.md`)
- Streamlit workbench → Excel report: exports report (evidence: `app.py`)
- Streamlit workbench → Raw-input predictor: builds predictor (evidence: `app.py`)
- Raw-input predictor → Prediction preparation: prepares inputs (evidence: `ml_workbench/inference.py`)
- Prediction preparation → Fold preprocessing: returns features (evidence: `ml_workbench/preprocessing.py`)
- Streamlit workbench → Serialized model: serializes model (evidence: `app.py`)
- Analyst → New tabular rows: provides rows
- New tabular rows → Raw-input predictor: requests predictions
- Raw-input predictor → Analyst: returns predictions
- Excel report → Analyst: downloads (evidence: `README.md`)
- Serialized model → Analyst: downloads
