# aaron2rodrigues/end-to-end-ann-project-with-mlflow architecture

> Architecture diagram of the GitHub repository aaron2rodrigues/end-to-end-ann-project-with-mlflow, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aaron2rodrigues/end-to-end-ann-project-with-mlflow
- Repository: https://github.com/aaron2rodrigues/end-to-end-ann-project-with-mlflow

## Overview

##### Main Components
- Main Orchestrator (main.py): The primary script that launches the entire training pipeline.
- Data Source: The UCI Wine Quality dataset (fetched from the provided URL).
- Data Preprocessing Component: Responsible for loading and normalizing the dataset.
- ANN Model Component: Built with TensorFlow/Keras; includes a normalization layer, a Dense (64 units, ReLU) layer, and an output layer (1 unit, linear). Also handles the loss (MSE) and evaluation metric (RMSE).
- Hyperparameter Optimization Module: Utilizes Hyperopt with a defined search space (learning rate and momentum) and the TPE algorithm to optimize training.

##### Out the Relationships and Data Flow
- From the Data Ingestion, lead to the Data Preprocessing block (data normalization and preparation).

##### Important Architectural Patterns and Technologies
- Client/Server (or Master/Worker) pattern: main.py triggers the overall training pipeline.
- Experiment Tracking and Logging: MLflow is configured as the central tracking mechanism, with artifacts stored in a dedicated mlruns directory. This division emphasizes the separation of model training and experiment management.
- Hyperparameter Optimization: Use of Hyperopt signifies an iterative loop that fine-tunes model parameters by interacting with the ANN Model.
- Frameworks: TensorFlow/Keras forms the backbone of the deep learning model, while Hyperopt and MLflow play crucial roles in tuning and tracking respectively.

## Diagram (Mermaid)

```mermaid
flowchart TD
    A["Main Orchestrator (main.py)"]:::orchestrator
    B["Data Source: Wine Quality Dataset (UCI)"]:::data
    C["Data Preprocessing"]:::processing

    subgraph "ANN Model"
        D["Normalization Layer"]:::ann
        E["Dense Layer (64 units, ReLU)"]:::ann
        F["Output Layer (1 unit, Linear)"]:::ann
        D --> E
        E --> F
    end

    G["Training Process"]:::ann
    H["Hyperparameter Optimization (Hyperopt)"]:::optimization
    I["MLflow Tracking"]:::tracking
    J["MLflow UI"]:::ui

    A -->|"triggers"| B
    B -->|"loads data"| C
    C -->|"prepares data"| D
    F -->|"initiates training"| G
    G -->|"tuning"| H
    H -->|"returns tuned_params"| G
    G -->|"logs metrics"| I
    I -->|"displays"| J

    click A "https://github.com/aaron2rodrigues/end-to-end-ann-project-with-mlflow/blob/main/main.py"
    click I "https://github.com/aaron2rodrigues/end-to-end-ann-project-with-mlflow/tree/main/mlruns"
    click F "https://github.com/aaron2rodrigues/end-to-end-ann-project-with-mlflow/tree/main/mlruns/*/artifacts/ANN-model"

    classDef orchestrator fill:#f9d5bb,stroke:#333,stroke-width:2px;
    classDef data fill:#cce5ff,stroke:#333,stroke-width:2px;
    classDef processing fill:#d5f9bb,stroke:#333,stroke-width:2px;
    classDef ann fill:#d5bbf9,stroke:#333,stroke-width:2px;
    classDef optimization fill:#f9bbd5,stroke:#333,stroke-width:2px;
    classDef tracking fill:#bbf9d5,stroke:#333,stroke-width:2px;
    classDef ui fill:#f9fbbd,stroke:#333,stroke-width:2px;
```
