# hassentchoketch/mlproject- architecture

> Architecture diagram of the GitHub repository hassentchoketch/mlproject-, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hassentchoketch/mlproject-
- Repository: https://github.com/hassentchoketch/mlproject-

## Overview

##### Project type and purpose
- This is a standalone Machine-Learning pipeline project (no GUI or web frontend).
- Purpose: train and persist a classifier for “MENA Labor Market Informality” and then run inference on new data.

##### File structure
- Top-level:
- artifacts/ (raw & split CSV data, pickled model + preprocessor)
- logs/ (pipeline execution logs)
- notebook/ (exploratory analysis)
- src/ (source code)
– components/ (data_ingestion.py, data_transformation.py, model_trainer.py)
– pipeline/ (train_pipeline.py, predict_pipeline.py)
– utils.py, logger.py, exception.py
- requirements.txt & setup.py (environment & packaging)
- Pattern: a linear pipeline with clear separation of concerns—Ingestion → Transformation → Training → Inference.

##### Detail
- Every component from src/components and src/pipeline
- Cross-cutting services (utils, exception, logger) as side-bars

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Data Stores
    DS["Data Sources\n(artifacts/data.csv,\ntrain.csv, test.csv)"]:::datastore
    click DS "https://github.com/hassentchoketch/mlproject-/blob/main/artifacts/data.csv"

    %% Processing Components
    subgraph "Training Pipeline"
        DI["Data Ingestion\n(data_ingestion.py)"]:::process
        click DI "https://github.com/hassentchoketch/mlproject-/blob/main/src/components/data_ingestion.py"
        DT["Data Transformation\n(data_transformation.py)"]:::process
        click DT "https://github.com/hassentchoketch/mlproject-/blob/main/src/components/data_transformation.py"
        MT["Model Trainer\n(model_trainer.py)"]:::process
        click MT "https://github.com/hassentchoketch/mlproject-/blob/main/src/components/model_trainer.py"
        TPS["Train Pipeline Script\n(train_pipeline.py)"]:::process
        click TPS "https://github.com/hassentchoketch/mlproject-/blob/main/src/pipeline/train_pipeline.py"
    end

    subgraph "Prediction Pipeline"
        PPS["Predict Pipeline Script\n(predict_pipeline.py)"]:::process
        click PPS "https://github.com/hassentchoketch/mlproject-/blob/main/src/pipeline/predict_pipeline.py"
    end

    %% Artifact Store
    MS["Model & Preprocessor Store\n(model.pkl, preprocessor.pkl)"]:::artifact
    click MS "https://github.com/hassentchoketch/mlproject-/blob/main/artifacts/model.pkl"

    %% Logging & Utilities
    LS["Logging Service\n(logger.py)"]:::utilities
    click LS "https://github.com/hassentchoketch/mlproject-/blob/main/src/logger.py"
    LF["Log Files\n(logs/*.log)"]:::datastore
    click LF "https://github.com/hassentchoketch/mlproject-/tree/main/logs/"

    UT["Utilities Module\n(utils.py)"]:::utilities
    click UT "https://github.com/hassentchoketch/mlproject-/blob/main/src/utils.py"
    EXC["Exception Module\n(exception.py)"]:::utilities
    click EXC "https://github.com/hassentchoketch/mlproject-/blob/main/src/exception.py"

    %% EDA Notebook (informational)
    subgraph "EDA Notebooks" 
        NB1["informality_data_for_analysis.csv"]:::datastore
        click NB1 "https://github.com/hassentchoketch/mlproject-/blob/main/notebook/informality_data_for_analysis.csv"
        NB2["informality_data_for_analysis.xlsx"]:::datastore
        click NB2 "https://github.com/hassentchoketch/mlproject-/blob/main/notebook/informality_data_for_analysis.xlsx"
    end

    %% Data Flow
    DS --> DI
    DI --> DT
    DT --> MT
    MT --> MS
    TPS --> DI
    TPS --> DT
    TPS --> MT
    PPS --> MS
    PPS -->|"reads model & preprocessor"| MS
    PPS -->|"outputs predictions"| MS

    %% Logging flows
    DI -->|logs events| LS
    DT -->|logs events| LS
    MT -->|logs events| LS
    TPS -->|logs events| LS
    PPS -->|logs events| LS
    LS --> LF

    %% Utilities & Exception cross-cutting
    UT -.-> DI
    UT -.-> DT
    UT -.-> MT
    UT -.-> PPS
    EXC -.-> DI
    EXC -.-> DT
    EXC -.-> MT
    EXC -.-> PPS

    %% EDA interactions
    NB1 -.-> DS
    NB2 -.-> DS

    %% Styling
    classDef datastore fill:#bbdefb,stroke:#1e88e5,color:#1e88e5;
    classDef process fill:#c8e6c9,stroke:#43a047,color:#388e3c;
    classDef artifact fill:#ffe0b2,stroke:#fb8c00,color:#e65100;
    classDef utilities fill:#e1bee7,stroke:#8e24aa,color:#6a1b9a;
```
