# trangkhanh-ai/steel-industry-energy-consumption architecture

> Architecture diagram of the GitHub repository trangkhanh-ai/steel-industry-energy-consumption, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/trangkhanh-ai/steel-industry-energy-consumption
- Repository: https://github.com/trangkhanh-ai/steel-industry-energy-consumption

## Overview

This repository publishes a data-preparation workflow for forecasting a steel plant’s total electricity use over the next 60 minutes; it does not include model training or deployment. The main workflow validates and chronologically orders the UCI readings, builds leakage-aware features and future targets, assigns time-based splits, then writes processed datasets and train-only exploratory figures. A separate audit script checks feature and leakage conditions, while a sequence utility exposes past-only windows for later deep-learning comparisons. The graph follows documented orchestration and source excerpts; it does not infer connections for unsampled internals.

Main entry points: [`src/steel/preprocessing.py`](https://github.com/trangkhanh-ai/steel-industry-energy-consumption/blob/main/src/steel/preprocessing.py) (Preprocessing), [`scripts/prepare_steel_data.py`](https://github.com/trangkhanh-ai/steel-industry-energy-consumption/blob/main/scripts/prepare_steel_data.py) (Preparation runner), [`data/steel/raw/Steel_industry_data.csv`](https://github.com/trangkhanh-ai/steel-industry-energy-consumption/blob/main/data/steel/raw/Steel_industry_data.csv) (UCI readings), [`src/steel/sequences.py`](https://github.com/trangkhanh-ai/steel-industry-energy-consumption/blob/main/src/steel/sequences.py) (Sequence windows)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingestion["Source validation"]
  node_raw_csv["UCI readings"]
end

subgraph group_engineering["Forecast preparation"]
  node_preprocessing["Preprocessing<br/>[preprocessing.py]"]
  node_prepare_cmd["Preparation runner"]
  node_supervised["Targets and features<br/>[preprocessing.py]"]
  node_time_splits["Time-based splits<br/>[preprocessing.py]"]
end

subgraph group_outputs["Preparation outputs"]
  node_processed_data["Processed datasets"]
  node_eda["Train-only exploration"]
  node_figures["EDA figures"]
end

subgraph group_analysis["Audit and sequences"]
  node_feature_audit["Feature audit"]
  node_sequence_view["Sequence windows<br/>[sequences.py]"]
end

node_analyst(("Project analyst"))

node_analyst -->|"runs preparation"| node_prepare_cmd
node_prepare_cmd -->|"loads and transforms"| node_preprocessing
node_raw_csv -->|"reads readings"| node_preprocessing
node_preprocessing -->|"builds targets"| node_supervised
node_preprocessing -->|"splits by time"| node_time_splits
node_prepare_cmd -->|"writes datasets"| node_processed_data
node_prepare_cmd -->|"generates exploration"| node_eda
node_eda -->|"writes figures"| node_figures
node_feature_audit -->|"checks splits"| node_processed_data
node_feature_audit -->|"checks source"| node_raw_csv
node_preprocessing -->|"provides shared definitions"| node_sequence_view
node_raw_csv -->|"supplies history"| node_sequence_view
node_supervised -->|"supplies targets"| node_sequence_view

click node_raw_csv "https://github.com/trangkhanh-ai/steel-industry-energy-consumption/blob/main/data/steel/raw/Steel_industry_data.csv"
click node_preprocessing "https://github.com/trangkhanh-ai/steel-industry-energy-consumption/blob/main/src/steel/preprocessing.py"
click node_prepare_cmd "https://github.com/trangkhanh-ai/steel-industry-energy-consumption/blob/main/scripts/prepare_steel_data.py"
click node_supervised "https://github.com/trangkhanh-ai/steel-industry-energy-consumption/blob/main/src/steel/preprocessing.py"
click node_time_splits "https://github.com/trangkhanh-ai/steel-industry-energy-consumption/blob/main/src/steel/preprocessing.py"
click node_processed_data "https://github.com/trangkhanh-ai/steel-industry-energy-consumption/tree/main/data/steel/processed"
click node_eda "https://github.com/trangkhanh-ai/steel-industry-energy-consumption/blob/main/scripts/prepare_steel_data.py"
click node_figures "https://github.com/trangkhanh-ai/steel-industry-energy-consumption/tree/main/reports/steel/figures"
click node_feature_audit "https://github.com/trangkhanh-ai/steel-industry-energy-consumption/blob/main/scripts/audit_features_and_leakage.py"
click node_sequence_view "https://github.com/trangkhanh-ai/steel-industry-energy-consumption/blob/main/src/steel/sequences.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_raw_csv toneBlue
class node_preprocessing,node_prepare_cmd,node_supervised,node_time_splits toneAmber
class node_processed_data,node_eda,node_figures toneMint
class node_feature_audit,node_sequence_view toneRose
class node_analyst toneIndigo
```

## Components

### Source validation

- [UCI readings](https://github.com/trangkhanh-ai/steel-industry-energy-consumption/blob/main/data/steel/raw/Steel_industry_data.csv): `data/steel/raw/Steel_industry_data.csv`

### Forecast preparation

- [Preprocessing](https://github.com/trangkhanh-ai/steel-industry-energy-consumption/blob/main/src/steel/preprocessing.py): `src/steel/preprocessing.py`
- [Preparation runner](https://github.com/trangkhanh-ai/steel-industry-energy-consumption/blob/main/scripts/prepare_steel_data.py): `scripts/prepare_steel_data.py`
- [Targets and features](https://github.com/trangkhanh-ai/steel-industry-energy-consumption/blob/main/src/steel/preprocessing.py): `src/steel/preprocessing.py`
- [Time-based splits](https://github.com/trangkhanh-ai/steel-industry-energy-consumption/blob/main/src/steel/preprocessing.py): `src/steel/preprocessing.py`

### Preparation outputs

- [Processed datasets](https://github.com/trangkhanh-ai/steel-industry-energy-consumption/tree/main/data/steel/processed): `data/steel/processed`
- [Train-only exploration](https://github.com/trangkhanh-ai/steel-industry-energy-consumption/blob/main/scripts/prepare_steel_data.py): `scripts/prepare_steel_data.py`
- [EDA figures](https://github.com/trangkhanh-ai/steel-industry-energy-consumption/tree/main/reports/steel/figures): `reports/steel/figures`

### Audit and sequences

- [Feature audit](https://github.com/trangkhanh-ai/steel-industry-energy-consumption/blob/main/scripts/audit_features_and_leakage.py): `scripts/audit_features_and_leakage.py`
- [Sequence windows](https://github.com/trangkhanh-ai/steel-industry-energy-consumption/blob/main/src/steel/sequences.py): `src/steel/sequences.py`

### Other components

- **Project analyst**

## Connections

- Project analyst → Preparation runner: runs preparation (evidence: `README.md`)
- Preparation runner → Preprocessing: loads and transforms (evidence: `scripts/prepare_steel_data.py`)
- UCI readings → Preprocessing: reads readings
- Preprocessing → Targets and features: builds targets (evidence: `scripts/prepare_steel_data.py`)
- Preprocessing → Time-based splits: splits by time (evidence: `scripts/prepare_steel_data.py`)
- Preparation runner → Processed datasets: writes datasets (evidence: `scripts/prepare_steel_data.py`)
- Preparation runner → Train-only exploration: generates exploration (evidence: `scripts/prepare_steel_data.py`)
- Train-only exploration → EDA figures: writes figures (evidence: `scripts/prepare_steel_data.py`)
- Feature audit → Processed datasets: checks splits (evidence: `scripts/audit_features_and_leakage.py`)
- Feature audit → UCI readings: checks source (evidence: `scripts/audit_features_and_leakage.py`)
- Preprocessing → Sequence windows: provides shared definitions (evidence: `src/steel/sequences.py`)
- UCI readings → Sequence windows: supplies history (evidence: `src/steel/sequences.py`)
- Targets and features → Sequence windows: supplies targets (evidence: `src/steel/sequences.py`)
