# tidianeyaloho/ml_tp2 architecture

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

- Interactive diagram: https://gitdiagram.com/tidianeyaloho/ml_tp2
- Repository: https://github.com/tidianeyaloho/ml_tp2

## Overview

This repository is a MetroPT-3 predictive-maintenance ML project: it turns compressor sensor readings into failure-warning classifications and evaluates models for recall-prioritized use. The root `main.py` is the documented user entry point and orchestrates loading, feature/label preparation, validation, model selection, compression, and final testing. The graph includes the documented visualization and results modules; the excerpts do not establish all their runtime call details, so no speculative links are added.

Main entry points: [`main.py`](https://github.com/tidianeyaloho/ml_tp2/blob/main/main.py) (Pipeline runner), [`src/data_loading.py`](https://github.com/tidianeyaloho/ml_tp2/blob/main/src/data_loading.py) (CSV loader), [`src/temporal_features.py`](https://github.com/tidianeyaloho/ml_tp2/blob/main/src/temporal_features.py) (Temporal features), [`src/label_creation.py`](https://github.com/tidianeyaloho/ml_tp2/blob/main/src/label_creation.py) (Failure labels)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data preparation"]
  node_loader["CSV loader<br/>[data_loading.py]"]
  node_temporal["Temporal features"]
  node_labels["Failure labels<br/>[label_creation.py]"]
  node_preprocess["Outlier treatment"]
  node_split["Chronological split<br/>[data_split.py]"]
  node_scaling["Feature scaling<br/>[feature_scaling.py]"]
end

subgraph group_analysis["Exploration"]
  node_exploration["Data exploration"]
  node_eda["Failure visualization"]
  node_plots["Result plots<br/>[plot_results.py]"]
  node_figure_generator["Figure generation"]
end

subgraph group_modeling["Modeling"]
  node_training["Model training<br/>[model_training.py]"]
end

subgraph group_delivery["Model assessment"]
  node_evaluation["Threshold evaluation"]
  node_comparison["Model comparison"]
  node_selection["Model selection<br/>[model_selection.py]"]
  node_compression["Model compression"]
  node_final["Final test evaluation"]
end

node_user(("Engineer"))
node_runner["Pipeline runner<br/>[main.py]"]

node_user -->|"runs pipeline"| node_runner
node_runner -->|"loads data"| node_loader
node_runner -->|"explores data"| node_exploration
node_runner -->|"creates features"| node_temporal
node_runner -->|"creates labels"| node_labels
node_runner -->|"visualizes failures"| node_eda
node_runner -->|"treats outliers"| node_preprocess
node_runner -->|"splits data"| node_split
node_runner -->|"scales features"| node_scaling
node_runner -->|"trains models"| node_training
node_runner -->|"tunes thresholds"| node_evaluation
node_runner -->|"compares models"| node_comparison
node_runner -->|"selects model"| node_selection
node_runner -->|"compresses models"| node_compression
node_runner -->|"tests model"| node_final

click node_runner "https://github.com/tidianeyaloho/ml_tp2/blob/main/main.py"
click node_loader "https://github.com/tidianeyaloho/ml_tp2/blob/main/src/data_loading.py"
click node_exploration "https://github.com/tidianeyaloho/ml_tp2/blob/main/src/data_exploration.py"
click node_temporal "https://github.com/tidianeyaloho/ml_tp2/blob/main/src/temporal_features.py"
click node_labels "https://github.com/tidianeyaloho/ml_tp2/blob/main/src/label_creation.py"
click node_eda "https://github.com/tidianeyaloho/ml_tp2/blob/main/src/eda_visualization.py"
click node_preprocess "https://github.com/tidianeyaloho/ml_tp2/blob/main/src/data_preprocessing.py"
click node_split "https://github.com/tidianeyaloho/ml_tp2/blob/main/src/data_split.py"
click node_scaling "https://github.com/tidianeyaloho/ml_tp2/blob/main/src/feature_scaling.py"
click node_training "https://github.com/tidianeyaloho/ml_tp2/blob/main/src/model_training.py"
click node_evaluation "https://github.com/tidianeyaloho/ml_tp2/blob/main/src/model_evaluation.py"
click node_comparison "https://github.com/tidianeyaloho/ml_tp2/blob/main/src/model_comparison.py"
click node_selection "https://github.com/tidianeyaloho/ml_tp2/blob/main/src/model_selection.py"
click node_compression "https://github.com/tidianeyaloho/ml_tp2/blob/main/src/model_compression.py"
click node_final "https://github.com/tidianeyaloho/ml_tp2/blob/main/src/final_evaluation.py"
click node_plots "https://github.com/tidianeyaloho/ml_tp2/blob/main/src/plot_results.py"
click node_figure_generator "https://github.com/tidianeyaloho/ml_tp2/blob/main/generate_figures.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_loader,node_temporal,node_labels,node_preprocess,node_split,node_scaling toneBlue
class node_exploration,node_eda,node_plots,node_figure_generator toneAmber
class node_training toneMint
class node_evaluation,node_comparison,node_selection,node_compression,node_final toneRose
class node_user toneIndigo
class node_runner toneTeal
```

## Components

### Data preparation

- [CSV loader](https://github.com/tidianeyaloho/ml_tp2/blob/main/src/data_loading.py): `src/data_loading.py`
- [Temporal features](https://github.com/tidianeyaloho/ml_tp2/blob/main/src/temporal_features.py): `src/temporal_features.py`
- [Failure labels](https://github.com/tidianeyaloho/ml_tp2/blob/main/src/label_creation.py): `src/label_creation.py`
- [Outlier treatment](https://github.com/tidianeyaloho/ml_tp2/blob/main/src/data_preprocessing.py): `src/data_preprocessing.py`
- [Chronological split](https://github.com/tidianeyaloho/ml_tp2/blob/main/src/data_split.py): `src/data_split.py`
- [Feature scaling](https://github.com/tidianeyaloho/ml_tp2/blob/main/src/feature_scaling.py): `src/feature_scaling.py`

### Exploration

- [Data exploration](https://github.com/tidianeyaloho/ml_tp2/blob/main/src/data_exploration.py): `src/data_exploration.py`
- [Failure visualization](https://github.com/tidianeyaloho/ml_tp2/blob/main/src/eda_visualization.py): `src/eda_visualization.py`
- [Result plots](https://github.com/tidianeyaloho/ml_tp2/blob/main/src/plot_results.py): `src/plot_results.py`
- [Figure generation](https://github.com/tidianeyaloho/ml_tp2/blob/main/generate_figures.py): `generate_figures.py`

### Modeling

- [Model training](https://github.com/tidianeyaloho/ml_tp2/blob/main/src/model_training.py): `src/model_training.py`

### Model assessment

- [Threshold evaluation](https://github.com/tidianeyaloho/ml_tp2/blob/main/src/model_evaluation.py): `src/model_evaluation.py`
- [Model comparison](https://github.com/tidianeyaloho/ml_tp2/blob/main/src/model_comparison.py): `src/model_comparison.py`
- [Model selection](https://github.com/tidianeyaloho/ml_tp2/blob/main/src/model_selection.py): `src/model_selection.py`
- [Model compression](https://github.com/tidianeyaloho/ml_tp2/blob/main/src/model_compression.py): `src/model_compression.py`
- [Final test evaluation](https://github.com/tidianeyaloho/ml_tp2/blob/main/src/final_evaluation.py): `src/final_evaluation.py`

### Other components

- **Engineer**
- [Pipeline runner](https://github.com/tidianeyaloho/ml_tp2/blob/main/main.py): `main.py`

## Connections

- Engineer → Pipeline runner: runs pipeline (evidence: `README.md`)
- Pipeline runner → CSV loader: loads data (evidence: `main.py`)
- Pipeline runner → Data exploration: explores data (evidence: `main.py`)
- Pipeline runner → Temporal features: creates features (evidence: `main.py`)
- Pipeline runner → Failure labels: creates labels (evidence: `main.py`)
- Pipeline runner → Failure visualization: visualizes failures (evidence: `main.py`)
- Pipeline runner → Outlier treatment: treats outliers (evidence: `main.py`)
- Pipeline runner → Chronological split: splits data (evidence: `main.py`)
- Pipeline runner → Feature scaling: scales features (evidence: `main.py`)
- Pipeline runner → Model training: trains models (evidence: `main.py`)
- Pipeline runner → Threshold evaluation: tunes thresholds (evidence: `main.py`)
- Pipeline runner → Model comparison: compares models (evidence: `main.py`)
- Pipeline runner → Model selection: selects model (evidence: `main.py`)
- Pipeline runner → Model compression: compresses models (evidence: `main.py`)
- Pipeline runner → Final test evaluation: tests model (evidence: `main.py`)
