# abonia1/github-action-for-ml architecture

> Architecture diagram of the GitHub repository abonia1/github-action-for-ml, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/abonia1/github-action-for-ml
- Repository: https://github.com/abonia1/github-action-for-ml

## Overview

- Data Source: Mark the CSV file “Churn_Modelling.csv” as the primary dataset.
- Data Processing & Model Training: Highlight “train.py” as the central module that reads the dataset, preprocesses the data, trains the Gradient Boosting model, and performs evaluations.
- CI/CD Pipeline: Represent GitHub Actions as a separate component. Indicate that the workflow is triggered on pushes and pull requests (using .github/workflows/main.yml).
- CML Integration: Show the integration of CML for generating dynamic reports. This component receives output (metrics, confusion matrix, ROC curve plots) from the training process.
- External Dependencies: Note that various libraries (Scikit-learn, Pandas, Matplotlib, etc.) from the “requirements.txt” support the model’s logic and evaluation.

##### Relationships and Interactions
- Within the train.py component, capture two sub-processes:
a. Data Preprocessing and Model Training (utilizing scikit-learn and Pandas).
b. Model Evaluation (producing visualizations like confusion matrix and ROC curve with Matplotlib).
- From the train.py module, indicate that the results (metrics and plots) are then passed to the CML component which formats and reports these outputs.
- Finally, include a connection between GitHub (repository) and the reporting output (PR comments or GitHub Actions logs) to show how feedback is provided back to developers.

##### Architectural Patterns and Design Principles
- Separation of concerns: The model training, evaluation, and CI/CD pipeline components are clearly isolated.
- Automation: The use of GitHub Actions and CML shows a continuous integration and continuous machine learning setup where new data or changes are automatically processed.
- Use of standard libraries and Python scripts, indicating a modular design even in a relatively simple project.

## Diagram (Mermaid)

```mermaid
graph TD
    subgraph "Data Layer"
        DS["Data Source (Churn_Modelling.csv)"]:::data
    end

    subgraph "ML Pipeline"
        T["Model Training & Evaluation (train.py)"]:::process
        PT["Data Preprocessing&Training"]:::process
        EV["Model Evaluation"]:::process
        REQ["External Dependencies (requirements.txt)"]:::external
        DS -->|"dataFlow"| T
        REQ -->|"dependency"| T
        T -->|"initiate"| PT
        PT -->|"produceResults"| EV
    end

    subgraph "Automation & Reporting"
        Repo["Repository"]:::repo
        CICD["CI/CD Pipeline (GitHubActions-main.yml)"]:::cicd
        CML["CML Reporting"]:::cicdSub
        Repo -->|"triggerPipeline"| CICD
        T -->|"outputs"| CML
        CICD -->|"generateReports"| CML
        DS ---|"repoEvents"| Repo
    end

    click DS "https://github.com/abonia1/github-action-for-ml/blob/main/Churn_Modelling.csv"
    click T "https://github.com/abonia1/github-action-for-ml/blob/main/train.py"
    click CICD "https://github.com/abonia1/github-action-for-ml/blob/main/.github/workflows/main.yml"
    click REQ "https://github.com/abonia1/github-action-for-ml/blob/main/requirements.txt"

    classDef data fill:#f9f,stroke:#333,stroke-width:2px;
    classDef process fill:#bbf,stroke:#333,stroke-width:2px;
    classDef external fill:#fbb,stroke:#333,stroke-width:2px;
    classDef cicd fill:#bfb,stroke:#333,stroke-width:2px;
    classDef cicdSub fill:#dfd,stroke:#333,stroke-width:2px;
    classDef repo fill:#ff9,stroke:#333,stroke-width:2px;
```
