# naveen2002-ncg/ml-automation-pipeline architecture

> Architecture diagram of the GitHub repository naveen2002-ncg/ml-automation-pipeline, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/naveen2002-ncg/ml-automation-pipeline
- Repository: https://github.com/naveen2002-ncg/ml-automation-pipeline

## Overview

This repository is an end-to-end classification pipeline. Its CLI entrypoint loads and splits Iris data, trains a Random Forest, evaluates metrics against an accuracy threshold, and exports a report and run log. Runtime configuration supplies environment-based parameters and output paths. The README documents the model, report, and log artifacts. Relationships are based on the sampled entrypoint and source modules; CI and tests are excluded as delivery infrastructure.

Main entry points: [`run_pipeline.py`](https://github.com/naveen2002-ncg/ml-automation-pipeline/blob/main/run_pipeline.py) (Pipeline entrypoint), [`src/config.py`](https://github.com/naveen2002-ncg/ml-automation-pipeline/blob/main/src/config.py) (Runtime configuration), [`src/model_trainer.py`](https://github.com/naveen2002-ncg/ml-automation-pipeline/blob/main/src/model_trainer.py) (Random Forest training), [`src/reporter.py`](https://github.com/naveen2002-ncg/ml-automation-pipeline/blob/main/src/reporter.py) (Report generation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Pipeline orchestration"]
  node_cli["Pipeline entrypoint<br/>[run_pipeline.py]"]
end

subgraph group_ml["Machine learning stages"]
  node_data["Data loading and split<br/>[data_loader.py]"]
  node_trainer["Random Forest training<br/>[model_trainer.py]"]
  node_evaluator["Metrics and threshold<br/>[evaluator.py]"]
end

subgraph group_outputs["Configuration and outputs"]
  node_reporter["Report generation<br/>[reporter.py]"]
  node_config["Runtime configuration<br/>[config.py]"]
  node_model_artifact[("Serialized model")]
  node_run_outputs["Report and run log"]
end

node_iris[("Iris dataset")]

node_cli -->|"reads settings"| node_config
node_cli -->|"loads and splits"| node_data
node_data -->|"loads dataset"| node_iris
node_cli -->|"trains and saves"| node_trainer
node_cli -->|"scores model"| node_evaluator
node_cli -->|"records and exports"| node_reporter
node_trainer -->|"serializes model"| node_model_artifact
node_reporter -->|"writes report and log"| node_run_outputs
node_trainer -->|"gets model path"| node_config
node_evaluator -->|"gets default threshold"| node_config
node_reporter -->|"gets output paths"| node_config

click node_cli "https://github.com/naveen2002-ncg/ml-automation-pipeline/blob/main/run_pipeline.py"
click node_data "https://github.com/naveen2002-ncg/ml-automation-pipeline/blob/main/src/data_loader.py"
click node_trainer "https://github.com/naveen2002-ncg/ml-automation-pipeline/blob/main/src/model_trainer.py"
click node_evaluator "https://github.com/naveen2002-ncg/ml-automation-pipeline/blob/main/src/evaluator.py"
click node_reporter "https://github.com/naveen2002-ncg/ml-automation-pipeline/blob/main/src/reporter.py"
click node_config "https://github.com/naveen2002-ncg/ml-automation-pipeline/blob/main/src/config.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_cli toneBlue
class node_data,node_trainer,node_evaluator,node_iris toneAmber
class node_reporter,node_config,node_model_artifact,node_run_outputs toneMint
```

## Components

### Pipeline orchestration

- [Pipeline entrypoint](https://github.com/naveen2002-ncg/ml-automation-pipeline/blob/main/run_pipeline.py): `run_pipeline.py`

### Machine learning stages

- [Data loading and split](https://github.com/naveen2002-ncg/ml-automation-pipeline/blob/main/src/data_loader.py): `src/data_loader.py`
- [Random Forest training](https://github.com/naveen2002-ncg/ml-automation-pipeline/blob/main/src/model_trainer.py): `src/model_trainer.py`
- [Metrics and threshold](https://github.com/naveen2002-ncg/ml-automation-pipeline/blob/main/src/evaluator.py): `src/evaluator.py`

### Configuration and outputs

- [Report generation](https://github.com/naveen2002-ncg/ml-automation-pipeline/blob/main/src/reporter.py): `src/reporter.py`
- [Runtime configuration](https://github.com/naveen2002-ncg/ml-automation-pipeline/blob/main/src/config.py): `src/config.py`
- **Serialized model**
- **Report and run log**

### Other components

- **Iris dataset**

## Connections

- Pipeline entrypoint → Runtime configuration: reads settings (evidence: `run_pipeline.py`)
- Pipeline entrypoint → Data loading and split: loads and splits (evidence: `run_pipeline.py`)
- Data loading and split → Iris dataset: loads dataset (evidence: `src/data_loader.py`)
- Pipeline entrypoint → Random Forest training: trains and saves (evidence: `run_pipeline.py`)
- Pipeline entrypoint → Metrics and threshold: scores model (evidence: `run_pipeline.py`)
- Pipeline entrypoint → Report generation: records and exports (evidence: `run_pipeline.py`)
- Random Forest training → Serialized model: serializes model (evidence: `src/model_trainer.py`)
- Report generation → Report and run log: writes report and log (evidence: `src/reporter.py`)
- Random Forest training → Runtime configuration: gets model path (evidence: `src/model_trainer.py`)
- Metrics and threshold → Runtime configuration: gets default threshold (evidence: `src/evaluator.py`)
- Report generation → Runtime configuration: gets output paths (evidence: `src/reporter.py`)
