# aaryawaghmare7/predictive-maintenance-ml architecture

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

- Interactive diagram: https://gitdiagram.com/aaryawaghmare7/predictive-maintenance-ml
- Repository: https://github.com/aaryawaghmare7/predictive-maintenance-ml

## Overview

This repository is a local EV predictive-maintenance ML project, not a hosted service. Its user workflow is to supply raw sensor data, inspect and clean it, explore target signal, then train/evaluate a model; the approved Experiment 2 adds fault-dataset auditing, model comparison, and local inference. The graph separates the paused Experiment 1 analysis from the NEV proof of concept. Some script-to-module links are based on SOURCE INDEX references; unsampled implementation details and runtime wiring are not inferred.

Main entry points: [`scripts/preprocess_dataset.py`](https://github.com/aaryawaghmare7/predictive-maintenance-ml/blob/main/scripts/preprocess_dataset.py) (Preprocessing run), [`src/training/train.py`](https://github.com/aaryawaghmare7/predictive-maintenance-ml/blob/main/src/training/train.py) (Failure baseline), [`scripts/run_nev_experiment.py`](https://github.com/aaryawaghmare7/predictive-maintenance-ml/blob/main/scripts/run_nev_experiment.py) (NEV experiment command), [`scripts`](https://github.com/aaryawaghmare7/predictive-maintenance-ml/tree/main/scripts) (Signal analysis commands)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data handling"]
  node_inspect["Dataset inspection<br/>[inspect_dataset.py]"]
  node_loader["Dataset loader<br/>[load_data.py]"]
  node_cleaning["Cleaning<br/>[cleaning.py]"]
  node_validation["Validation<br/>[validation.py]"]
  node_clean_script["Preprocessing run"]
end

subgraph group_exp1["Experiment 1"]
  node_failure["Failure signal analysis<br/>[failure_signal.py]"]
  node_maintenance["Maintenance signal analysis"]
  node_signal_runs["Signal analysis commands"]
  node_baseline["Failure baseline<br/>[train.py]"]
  node_baseline_run["Baseline command<br/>[train_baseline.py]"]
end

subgraph group_nev["NEV diagnosis"]
  node_nev_data["NEV data checks<br/>[nev_fault.py]"]
  node_nev_eda["NEV audit and EDA<br/>[nev_fault.py]"]
  node_nev_training["Candidate selection and training<br/>[nev_fault.py]"]
  node_nev_prediction["Local fault inference<br/>[nev_fault.py]"]
  node_nev_run["NEV experiment command"]
end

subgraph group_shared["Shared ML services"]
  node_metrics["Classification metrics<br/>[metrics.py]"]
  node_config["Project paths<br/>[paths.py]"]
end

node_analyst(("Project user"))
node_raw_data[("Raw EV datasets")]
node_processed[("Cleaned dataset")]
node_model_artifact[("Saved pipeline<br/>[metadata.json]")]

node_analyst -->|"inspects data"| node_inspect
node_raw_data -->|"reads"| node_inspect
node_inspect -->|"loads"| node_loader
node_analyst -->|"runs preprocessing"| node_clean_script
node_clean_script -->|"loads input"| node_loader
node_clean_script -->|"cleans"| node_cleaning
node_clean_script -->|"validates"| node_validation
node_clean_script -->|"writes cleaned data"| node_processed
node_analyst -->|"runs analysis"| node_signal_runs
node_signal_runs -->|"loads data"| node_loader
node_signal_runs -->|"analyzes failure"| node_failure
node_signal_runs -->|"analyzes maintenance"| node_maintenance
node_failure -->|"selects features"| node_cleaning
node_maintenance -->|"selects features"| node_cleaning
node_analyst -->|"runs baseline"| node_baseline_run
node_baseline_run -->|"starts training"| node_baseline
node_baseline -->|"loads raw data"| node_loader
node_baseline -->|"selects features"| node_cleaning
node_baseline -->|"evaluates predictions"| node_metrics
node_analyst -->|"runs experiment"| node_nev_run
node_nev_run -->|"loads and checks"| node_nev_data
node_nev_run -->|"runs audit"| node_nev_eda
node_nev_run -->|"trains candidates"| node_nev_training
node_nev_eda -->|"uses dataset schema"| node_nev_data
node_nev_training -->|"prepares inputs"| node_nev_data
node_nev_training -->|"scores test results"| node_metrics
node_nev_training -->|"saves pipeline metadata"| node_model_artifact
node_analyst -->|"requests local inference"| node_nev_prediction
node_model_artifact -->|"supplies fitted pipeline"| node_nev_prediction
node_nev_prediction -->|"validates sensor inputs"| node_nev_data
node_nev_run -->|"uses project paths"| node_config
node_clean_script -->|"uses project paths"| node_config
node_baseline -->|"uses raw-data path"| node_config

click node_inspect "https://github.com/aaryawaghmare7/predictive-maintenance-ml/blob/main/scripts/inspect_dataset.py"
click node_loader "https://github.com/aaryawaghmare7/predictive-maintenance-ml/blob/main/src/data/load_data.py"
click node_cleaning "https://github.com/aaryawaghmare7/predictive-maintenance-ml/blob/main/src/preprocessing/cleaning.py"
click node_validation "https://github.com/aaryawaghmare7/predictive-maintenance-ml/blob/main/src/preprocessing/validation.py"
click node_clean_script "https://github.com/aaryawaghmare7/predictive-maintenance-ml/blob/main/scripts/preprocess_dataset.py"
click node_failure "https://github.com/aaryawaghmare7/predictive-maintenance-ml/blob/main/src/eda/failure_signal.py"
click node_maintenance "https://github.com/aaryawaghmare7/predictive-maintenance-ml/blob/main/src/eda/maintenance_type_signal.py"
click node_signal_runs "https://github.com/aaryawaghmare7/predictive-maintenance-ml/tree/main/scripts"
click node_baseline "https://github.com/aaryawaghmare7/predictive-maintenance-ml/blob/main/src/training/train.py"
click node_baseline_run "https://github.com/aaryawaghmare7/predictive-maintenance-ml/blob/main/scripts/train_baseline.py"
click node_nev_data "https://github.com/aaryawaghmare7/predictive-maintenance-ml/blob/main/src/data/nev_fault.py"
click node_nev_eda "https://github.com/aaryawaghmare7/predictive-maintenance-ml/blob/main/src/eda/nev_fault.py"
click node_nev_training "https://github.com/aaryawaghmare7/predictive-maintenance-ml/blob/main/src/training/nev_fault.py"
click node_metrics "https://github.com/aaryawaghmare7/predictive-maintenance-ml/blob/main/src/evaluation/metrics.py"
click node_nev_prediction "https://github.com/aaryawaghmare7/predictive-maintenance-ml/blob/main/src/prediction/nev_fault.py"
click node_nev_run "https://github.com/aaryawaghmare7/predictive-maintenance-ml/blob/main/scripts/run_nev_experiment.py"
click node_model_artifact "https://github.com/aaryawaghmare7/predictive-maintenance-ml/blob/main/models/experiment_2/metadata.json"
click node_config "https://github.com/aaryawaghmare7/predictive-maintenance-ml/blob/main/src/config/paths.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_inspect,node_loader,node_cleaning,node_validation,node_clean_script,node_analyst toneBlue
class node_failure,node_maintenance,node_signal_runs,node_baseline,node_baseline_run,node_raw_data,node_processed,node_model_artifact toneAmber
class node_nev_data,node_nev_eda,node_nev_training,node_nev_prediction,node_nev_run toneMint
class node_metrics,node_config toneRose
```

## Components

### Data handling

- [Dataset inspection](https://github.com/aaryawaghmare7/predictive-maintenance-ml/blob/main/scripts/inspect_dataset.py): `scripts/inspect_dataset.py`
- [Dataset loader](https://github.com/aaryawaghmare7/predictive-maintenance-ml/blob/main/src/data/load_data.py): `src/data/load_data.py`
- [Cleaning](https://github.com/aaryawaghmare7/predictive-maintenance-ml/blob/main/src/preprocessing/cleaning.py): `src/preprocessing/cleaning.py`
- [Validation](https://github.com/aaryawaghmare7/predictive-maintenance-ml/blob/main/src/preprocessing/validation.py): `src/preprocessing/validation.py`
- [Preprocessing run](https://github.com/aaryawaghmare7/predictive-maintenance-ml/blob/main/scripts/preprocess_dataset.py): `scripts/preprocess_dataset.py`

### Experiment 1

- [Failure signal analysis](https://github.com/aaryawaghmare7/predictive-maintenance-ml/blob/main/src/eda/failure_signal.py): `src/eda/failure_signal.py`
- [Maintenance signal analysis](https://github.com/aaryawaghmare7/predictive-maintenance-ml/blob/main/src/eda/maintenance_type_signal.py): `src/eda/maintenance_type_signal.py`
- [Signal analysis commands](https://github.com/aaryawaghmare7/predictive-maintenance-ml/tree/main/scripts): `scripts`
- [Failure baseline](https://github.com/aaryawaghmare7/predictive-maintenance-ml/blob/main/src/training/train.py): `src/training/train.py`
- [Baseline command](https://github.com/aaryawaghmare7/predictive-maintenance-ml/blob/main/scripts/train_baseline.py): `scripts/train_baseline.py`

### NEV diagnosis

- [NEV data checks](https://github.com/aaryawaghmare7/predictive-maintenance-ml/blob/main/src/data/nev_fault.py): `src/data/nev_fault.py`
- [NEV audit and EDA](https://github.com/aaryawaghmare7/predictive-maintenance-ml/blob/main/src/eda/nev_fault.py): `src/eda/nev_fault.py`
- [Candidate selection and training](https://github.com/aaryawaghmare7/predictive-maintenance-ml/blob/main/src/training/nev_fault.py): `src/training/nev_fault.py`
- [Local fault inference](https://github.com/aaryawaghmare7/predictive-maintenance-ml/blob/main/src/prediction/nev_fault.py): `src/prediction/nev_fault.py`
- [NEV experiment command](https://github.com/aaryawaghmare7/predictive-maintenance-ml/blob/main/scripts/run_nev_experiment.py): `scripts/run_nev_experiment.py`

### Shared ML services

- [Classification metrics](https://github.com/aaryawaghmare7/predictive-maintenance-ml/blob/main/src/evaluation/metrics.py): `src/evaluation/metrics.py`
- [Project paths](https://github.com/aaryawaghmare7/predictive-maintenance-ml/blob/main/src/config/paths.py): `src/config/paths.py`

### Other components

- **Project user**
- **Raw EV datasets**
- **Cleaned dataset**
- [Saved pipeline](https://github.com/aaryawaghmare7/predictive-maintenance-ml/blob/main/models/experiment_2/metadata.json): `models/experiment_2/metadata.json`

## Connections

- Project user → Dataset inspection: inspects data (evidence: `README.md`)
- Raw EV datasets → Dataset inspection: reads (evidence: `scripts/inspect_dataset.py`)
- Dataset inspection → Dataset loader: loads (evidence: `scripts/inspect_dataset.py`)
- Project user → Preprocessing run: runs preprocessing (evidence: `README.md`)
- Preprocessing run → Dataset loader: loads input (evidence: `scripts/preprocess_dataset.py`)
- Preprocessing run → Cleaning: cleans (evidence: `scripts/preprocess_dataset.py`)
- Preprocessing run → Validation: validates (evidence: `scripts/preprocess_dataset.py`)
- Preprocessing run → Cleaned dataset: writes cleaned data (evidence: `README.md`)
- Project user → Signal analysis commands: runs analysis (evidence: `README.md`)
- Signal analysis commands → Dataset loader: loads data (evidence: `scripts/analyze_failure_signal.py`)
- Signal analysis commands → Failure signal analysis: analyzes failure (evidence: `scripts/analyze_failure_signal.py`)
- Signal analysis commands → Maintenance signal analysis: analyzes maintenance (evidence: `scripts/analyze_maintenance_type_signal.py`)
- Failure signal analysis → Cleaning: selects features (evidence: `src/eda/failure_signal.py`)
- Maintenance signal analysis → Cleaning: selects features (evidence: `src/eda/maintenance_type_signal.py`)
- Project user → Baseline command: runs baseline (evidence: `README.md`)
- Baseline command → Failure baseline: starts training (evidence: `scripts/train_baseline.py`)
- Failure baseline → Dataset loader: loads raw data (evidence: `src/training/train.py`)
- Failure baseline → Cleaning: selects features (evidence: `src/training/train.py`)
- Failure baseline → Classification metrics: evaluates predictions (evidence: `src/training/train.py`)
- Project user → NEV experiment command: runs experiment (evidence: `README.md`)
- NEV experiment command → NEV data checks: loads and checks (evidence: `scripts/run_nev_experiment.py`)
- NEV experiment command → NEV audit and EDA: runs audit (evidence: `scripts/run_nev_experiment.py`)
- NEV experiment command → Candidate selection and training: trains candidates (evidence: `scripts/run_nev_experiment.py`)
- NEV audit and EDA → NEV data checks: uses dataset schema (evidence: `src/eda/nev_fault.py`)
- Candidate selection and training → NEV data checks: prepares inputs (evidence: `src/training/nev_fault.py`)
- Candidate selection and training → Classification metrics: scores test results (evidence: `src/training/nev_fault.py`)
- Candidate selection and training → Saved pipeline: saves pipeline metadata (evidence: `README.md`)
- Project user → Local fault inference: requests local inference (evidence: `README.md`)
- Saved pipeline → Local fault inference: supplies fitted pipeline (evidence: `README.md`)
- Local fault inference → NEV data checks: validates sensor inputs (evidence: `src/prediction/nev_fault.py`)
- NEV experiment command → Project paths: uses project paths (evidence: `scripts/run_nev_experiment.py`)
- Preprocessing run → Project paths: uses project paths (evidence: `scripts/preprocess_dataset.py`)
- Failure baseline → Project paths: uses raw-data path (evidence: `src/training/train.py`)
