# sweezalsuares/nexusretail-ai-powered-e-commerce-customer-intelligence architecture

> Architecture diagram of the GitHub repository sweezalsuares/nexusretail-ai-powered-e-commerce-customer-intelligence, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sweezalsuares/nexusretail-ai-powered-e-commerce-customer-intelligence
- Repository: https://github.com/sweezalsuares/nexusretail-ai-powered-e-commerce-customer-intelligence

## Overview

NexusRetail trains three order-level classifiers—profitability, delivery speed, and return risk—and exposes their results through a Streamlit dashboard and prediction interface. Training loads retail orders, creates targets and engineered features, selects features, fits ANN and gradient-boosting pipelines, evaluates them, and saves model and report artifacts. Users explore dataset and model diagnostics, adjust thresholds, or submit single and batch orders for predictions. The dashboard and prediction workflow are documented; some dashboard internals are only partially excerpted, so edges are limited to documented or indexed references.

Main entry points: [`src/train.py`](https://github.com/sweezalsuares/nexusretail-ai-powered-e-commerce-customer-intelligence/blob/main/src/train.py) (Training orchestrator), [`src/data_prep.py`](https://github.com/sweezalsuares/nexusretail-ai-powered-e-commerce-customer-intelligence/blob/main/src/data_prep.py) (Targets and features), [`src/predict.py`](https://github.com/sweezalsuares/nexusretail-ai-powered-e-commerce-customer-intelligence/blob/main/src/predict.py) (Order prediction), [`app/streamlit_app.py`](https://github.com/sweezalsuares/nexusretail-ai-powered-e-commerce-customer-intelligence/blob/main/app/streamlit_app.py) (Retail dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_training["Model training"]
  node_config["Project settings<br/>[config.py]"]
  node_prep["Targets and features<br/>[data_prep.py]"]
  node_selection["Feature selection"]
  node_pipelines["ANN and HGB pipelines<br/>[models.py]"]
  node_trainer["Training orchestrator<br/>[train.py]"]
  node_evaluation["Model evaluation<br/>[evaluate.py]"]
  node_static_plots["Static diagnostics<br/>[plots.py]"]
end

subgraph group_inference["Prediction"]
  node_predictor["Order prediction<br/>[predict.py]"]
end

subgraph group_experience["Dashboard"]
  node_dashboard["Retail dashboard<br/>[streamlit_app.py]"]
end

subgraph group_artifacts["Data and artifacts"]
  node_orders["Order dataset"]
  node_saved_models["Saved pipelines"]
  node_reports["Metrics and predictions"]
end

node_retail_user(("Retail user"))
node_cli_user(("CLI user"))

node_retail_user -->|"explores and submits"| node_dashboard
node_cli_user -->|"scores orders"| node_predictor
node_prep -->|"loads orders"| node_orders
node_prep -->|"uses data settings"| node_config
node_trainer -->|"uses training settings"| node_config
node_trainer -->|"loads and transforms"| node_prep
node_trainer -->|"selects features"| node_selection
node_selection -->|"uses feature definitions"| node_prep
node_trainer -->|"builds classifiers"| node_pipelines
node_pipelines -->|"engineers features"| node_prep
node_trainer -->|"computes metrics"| node_evaluation
node_trainer -->|"creates figures"| node_static_plots
node_trainer -->|"saves pipelines"| node_saved_models
node_trainer -->|"writes metrics and predictions"| node_reports
node_static_plots -->|"saves figures"| node_reports
node_predictor -->|"loads pipelines"| node_saved_models
node_predictor -->|"reads thresholds"| node_reports
node_predictor -->|"validates input schema"| node_prep
node_dashboard -->|"requests predictions"| node_predictor
node_dashboard -->|"loads dataset"| node_prep
node_dashboard -->|"uses app settings"| node_config

click node_orders "https://github.com/sweezalsuares/nexusretail-ai-powered-e-commerce-customer-intelligence/blob/main/data/ecommerce_sales_34500.csv"
click node_config "https://github.com/sweezalsuares/nexusretail-ai-powered-e-commerce-customer-intelligence/blob/main/config.py"
click node_prep "https://github.com/sweezalsuares/nexusretail-ai-powered-e-commerce-customer-intelligence/blob/main/src/data_prep.py"
click node_selection "https://github.com/sweezalsuares/nexusretail-ai-powered-e-commerce-customer-intelligence/blob/main/src/feature_selection.py"
click node_pipelines "https://github.com/sweezalsuares/nexusretail-ai-powered-e-commerce-customer-intelligence/blob/main/src/models.py"
click node_trainer "https://github.com/sweezalsuares/nexusretail-ai-powered-e-commerce-customer-intelligence/blob/main/src/train.py"
click node_evaluation "https://github.com/sweezalsuares/nexusretail-ai-powered-e-commerce-customer-intelligence/blob/main/src/evaluate.py"
click node_static_plots "https://github.com/sweezalsuares/nexusretail-ai-powered-e-commerce-customer-intelligence/blob/main/src/plots.py"
click node_saved_models "https://github.com/sweezalsuares/nexusretail-ai-powered-e-commerce-customer-intelligence/tree/main/models"
click node_reports "https://github.com/sweezalsuares/nexusretail-ai-powered-e-commerce-customer-intelligence/tree/main/reports"
click node_predictor "https://github.com/sweezalsuares/nexusretail-ai-powered-e-commerce-customer-intelligence/blob/main/src/predict.py"
click node_dashboard "https://github.com/sweezalsuares/nexusretail-ai-powered-e-commerce-customer-intelligence/blob/main/app/streamlit_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_config,node_prep,node_selection,node_pipelines,node_trainer,node_evaluation,node_static_plots,node_retail_user,node_cli_user toneBlue
class node_predictor toneAmber
class node_dashboard toneMint
class node_orders,node_saved_models,node_reports toneRose
```

## Components

### Model training

- [Project settings](https://github.com/sweezalsuares/nexusretail-ai-powered-e-commerce-customer-intelligence/blob/main/config.py): `config.py`
- [Targets and features](https://github.com/sweezalsuares/nexusretail-ai-powered-e-commerce-customer-intelligence/blob/main/src/data_prep.py): `src/data_prep.py`
- [Feature selection](https://github.com/sweezalsuares/nexusretail-ai-powered-e-commerce-customer-intelligence/blob/main/src/feature_selection.py): `src/feature_selection.py`
- [ANN and HGB pipelines](https://github.com/sweezalsuares/nexusretail-ai-powered-e-commerce-customer-intelligence/blob/main/src/models.py): `src/models.py`
- [Training orchestrator](https://github.com/sweezalsuares/nexusretail-ai-powered-e-commerce-customer-intelligence/blob/main/src/train.py): `src/train.py`
- [Model evaluation](https://github.com/sweezalsuares/nexusretail-ai-powered-e-commerce-customer-intelligence/blob/main/src/evaluate.py): `src/evaluate.py`
- [Static diagnostics](https://github.com/sweezalsuares/nexusretail-ai-powered-e-commerce-customer-intelligence/blob/main/src/plots.py): `src/plots.py`

### Prediction

- [Order prediction](https://github.com/sweezalsuares/nexusretail-ai-powered-e-commerce-customer-intelligence/blob/main/src/predict.py): `src/predict.py`

### Dashboard

- [Retail dashboard](https://github.com/sweezalsuares/nexusretail-ai-powered-e-commerce-customer-intelligence/blob/main/app/streamlit_app.py): `app/streamlit_app.py`

### Data and artifacts

- [Order dataset](https://github.com/sweezalsuares/nexusretail-ai-powered-e-commerce-customer-intelligence/blob/main/data/ecommerce_sales_34500.csv): `data/ecommerce_sales_34500.csv`
- [Saved pipelines](https://github.com/sweezalsuares/nexusretail-ai-powered-e-commerce-customer-intelligence/tree/main/models): `models`
- [Metrics and predictions](https://github.com/sweezalsuares/nexusretail-ai-powered-e-commerce-customer-intelligence/tree/main/reports): `reports`

### Other components

- **Retail user**
- **CLI user**

## Connections

- Retail user → Retail dashboard: explores and submits (evidence: `README.md`)
- CLI user → Order prediction: scores orders (evidence: `README.md`)
- Targets and features → Order dataset: loads orders (evidence: `src/data_prep.py`)
- Targets and features → Project settings: uses data settings (evidence: `src/data_prep.py`)
- Training orchestrator → Project settings: uses training settings (evidence: `src/train.py`)
- Training orchestrator → Targets and features: loads and transforms (evidence: `src/train.py`)
- Training orchestrator → Feature selection: selects features (evidence: `src/train.py`)
- Feature selection → Targets and features: uses feature definitions (evidence: `src/feature_selection.py`)
- Training orchestrator → ANN and HGB pipelines: builds classifiers (evidence: `src/train.py`)
- ANN and HGB pipelines → Targets and features: engineers features (evidence: `src/models.py`)
- Training orchestrator → Model evaluation: computes metrics (evidence: `src/train.py`)
- Training orchestrator → Static diagnostics: creates figures (evidence: `src/train.py`)
- Training orchestrator → Saved pipelines: saves pipelines (evidence: `src/train.py`)
- Training orchestrator → Metrics and predictions: writes metrics and predictions (evidence: `src/train.py`)
- Static diagnostics → Metrics and predictions: saves figures (evidence: `src/plots.py`)
- Order prediction → Saved pipelines: loads pipelines (evidence: `src/predict.py`)
- Order prediction → Metrics and predictions: reads thresholds (evidence: `src/predict.py`)
- Order prediction → Targets and features: validates input schema (evidence: `src/predict.py`)
- Retail dashboard → Order prediction: requests predictions (evidence: `app/streamlit_app.py`)
- Retail dashboard → Targets and features: loads dataset (evidence: `app/streamlit_app.py`)
- Retail dashboard → Project settings: uses app settings (evidence: `app/streamlit_app.py`)
