# safiamc/udacity-intro-to-ml-project1 architecture

> Architecture diagram of the GitHub repository safiamc/udacity-intro-to-ml-project1, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/safiamc/udacity-intro-to-ml-project1
- Repository: https://github.com/safiamc/udacity-intro-to-ml-project1

## Overview

##### Main Components
- Data Sources: Represent the raw datasets — train.csv, test.csv, and the various submission CSV files, which contain historical bike-sharing data.
- Data Preprocessing & Feature Engineering: Highlight the stage where datetime information is decomposed into components (years, months, day of the week, and hour), which is clearly a critical step mentioned in the README. This can be represented as a processing module, likely developed interactively using the provided Jupyter Notebook (project-template.ipynb).
- Model Training with AutoGluon: Illustrate the core ML pipeline where AutoGluon automates model selection, training, and tuning. This stage is also associated with AWS SageMaker, implying the use of cloud-based computing resources.
- Hyperparameter Tuning: Although improvements here were modest, it is a distinct module contributing toward overall model performance.
- Evaluation & Reporting: Include components for generating reports (such as report-template.md and project-template.html) that document model performance and findings.
- CI/CD Integration: Indicate the automation aspects using GitHub Actions workflows (under .github/workflows) which can be used for testing, validation, or even managing the model execution pipeline.

- Data sources to a Preprocessing module where feature engineering is performed.

##### Architectural Patterns & Technologies
- A data pipeline pattern: Data ingestion → preprocessing/feature engineering → model training → evaluation.
- Use of cloud-based services (AWS SageMaker) and automated ML (AutoGluon).
- Recognize that while the project is not split into distinct “frontend” and “backend” layers, its components are still modularized in the context of ML pipelines – which is typical for data science projects.
- The use of GitHub workflows underlines a modern, DevOps-oriented approach to ensuring continuous integration and reproducibility.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Data Sources Subgraph
    subgraph "Data Sources"
        train["train.csv"]:::datasource
        test["test.csv"]:::datasource
        submission["submission.csv"]:::datasource
        submission_new_features["submission_new_features.csv"]:::datasource
        submission_new_hpo3["submission_new_hpo3.csv"]:::datasource
    end

    %% Preprocessing / Feature Engineering
    preprocess["Preprocessing & Feature Engineering\n(extract datetime features)"]:::preprocess

    %% Model Training on AWS SageMaker using AutoGluon (includes hyperparameter tuning)
    training["Model Training (AutoGluon on AWS SageMaker)"]:::training

    %% Evaluation & Reporting Subgraph
    subgraph "Evaluation & Reporting"
        eval_html["project-template.html"]:::evaluation
        eval_md["report-template.md"]:::evaluation
    end

    %% CI/CD Pipeline
    cicd["CI/CD Pipeline\n(GitHub Workflows)"]:::cicd

    %% Connections from Data Sources to Preprocessing
    train --> preprocess
    test --> preprocess
    submission --> preprocess
    submission_new_features --> preprocess
    submission_new_hpo3 --> preprocess

    %% Connection from Preprocessing to Model Training
    preprocess --> training

    %% Connection from Model Training to Evaluation outputs
    training --> eval_html
    training --> eval_md

    %% CI/CD interactions with Model Training and Evaluation
    cicd -.-> training
    cicd -.-> eval_html

    %% Click Events for Data Sources
    click train "https://github.com/safiamc/udacity-intro-to-ml-project1/blob/master/train.csv"
    click test "https://github.com/safiamc/udacity-intro-to-ml-project1/blob/master/test.csv"
    click submission "https://github.com/safiamc/udacity-intro-to-ml-project1/blob/master/submission.csv"
    click submission_new_features "https://github.com/safiamc/udacity-intro-to-ml-project1/blob/master/submission_new_features.csv"
    click submission_new_hpo3 "https://github.com/safiamc/udacity-intro-to-ml-project1/blob/master/submission_new_hpo3.csv"

    %% Click Event for Preprocessing & Feature Engineering (using project-template.ipynb)
    click preprocess "https://github.com/safiamc/udacity-intro-to-ml-project1/blob/master/project-template.ipynb"

    %% Click Event for Model Training (using project-template.ipynb)
    click training "https://github.com/safiamc/udacity-intro-to-ml-project1/blob/master/project-template.ipynb"

    %% Click Events for Evaluation & Reporting
    click eval_html "https://github.com/safiamc/udacity-intro-to-ml-project1/blob/master/project-template.html"
    click eval_md "https://github.com/safiamc/udacity-intro-to-ml-project1/blob/master/report-template.md"

    %% Click Event for CI/CD Pipeline
    click cicd "https://github.com/safiamc/udacity-intro-to-ml-project1/blob/master/.github/workflows/manual.yml"

    %% Styles
    classDef datasource fill:#a8dadc,stroke:#457b9d,stroke-width:2px;
    classDef preprocess fill:#f1faee,stroke:#1d3557,stroke-width:2px;
    classDef training fill:#b7e4c7,stroke:#1d3557,stroke-width:2px;
    classDef evaluation fill:#ffddd2,stroke:#e63946,stroke-width:2px;
    classDef cicd fill:#ffd6a5,stroke:#ffb703,stroke-width:2px;
```
