# swagath18/comprehensive_regression_model_evaluation_e2e_ml architecture

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

- Interactive diagram: https://gitdiagram.com/swagath18/comprehensive_regression_model_evaluation_e2e_ml
- Repository: https://github.com/swagath18/comprehensive_regression_model_evaluation_e2e_ml

## Overview

##### Project Type and Purpose
- This project implements a full machine learning lifecycle for regression modeling. It covers Exploratory Data Analysis (EDA), data ingestion, data transformation, model training (using CatBoost and possibly other regression approaches), and deployment through dedicated pipelines.
- The project also stresses modular coding, logging, and CI/CD, ensuring that the system reliably handles both training and prediction tasks.

##### Main Components
──────────────────────────────────────────────────────────
[Notebooks/EDA]
- Contains Jupyter notebooks (e.g., “Student_performance_EDA.ipynb”, “2. MODEL TRAINING.ipynb”) used for data exploration and model prototyping.

[Artifacts]
- Houses all generated outputs including data splits (train.csv, test.csv), preprocessed files, serialized models (model.pkl), and preprocessing objects (preprocessor.pkl).
- Acts as the central repository for model artifacts that might be used by the deployment pipeline.

[Source Code (src)]
- Core Components:
- Data Ingestion (src/components/data_ingestion.py): Responsible for sourcing and reading raw data.
- Data Transformation (src/components/data_transformation.py): Handles any data cleaning, normalization, or feature engineering tasks.
- Model Trainer (src/components/model_trainer.py): Contains logic for training regression models using CatBoost (as suggested by the “catboost_info” directory).
- Pipeline Scripts:
- Train Pipeline (src/pipeline/train_pipeline.py): Orchestrates the entire training process from ingestion to model training.
- Predict Pipeline (src/pipeline/predict_pipeline.py): Manages steps needed to load the model artifact and perform predictions.
- Utilities and Logging:
- Utility Module (src/utils.py): Houses helper functions.
- Logger (src/logger.py) and Exception Handling (src/exception.py): Provide robust error tracking and logging.

[Supporting Files & CI/CD]
- Configuration and Installation (requirements.txt, setup.py): Define dependencies and installation steps.
- Documentation (README.md, Step_by_step_project_guide.doc): Provide guidance, instructions, and architectural overview.
- CatBoost Metadata (catboost_info and its copy inside notebook/catboost_info): Stores training logs and status for CatBoost, primarily supporting model training tracking.

##### Relationships and Interactions
- Data Flow:
- Start from data ingestion reading raw datasets (located in artifacts or provided by notebooks).
- Move through data transformation to enable proper feature engineering.
- Pass transformed data to the model trainer which then outputs a serialized model and associated preprocessor.
- Trained model along with supplementary artifacts moves into a deployment phase managed by the predict pipeline.
- Communication:
- Notebooks provide experimental feedback and can be seen as semi-production prototypes.
- The pipelines act as orchestrators linking components and ensuring that the data, transformation, training, and prediction components work in tandem.
- Logging and Error Management:
- The system extensively logs events (using src/logger.py) and tracks errors (using src/exception.py) which should be represented as a supportive overlay in the design.

##### Architectural Patterns and Design Principles
- Modular Design: Each functional block (ingestion, transformation, training, prediction) is isolated, making it easy to swap or update parts without affecting the whole system.
- Separation of Concerns: Clear distinction between data handling (components) and orchestration (pipelines), ensuring maintainability.
- CI/CD Integration: Though not represented directly in the file tree, the documentation indicates a streamlined deployment process. This integration can be shown as a separate external pipeline interacting with the code repository to trigger automated tests, training, and deployment.

- Top Level: Begin with the user input or raw data repository.
- Bottom Level: Deployment flow via the Predict Pipeline.
- Additional Elements: Logging, Exception, and Utility modules can be shown as supporting infrastructures that interact with each pipeline block.
- Block connections are “clean” and organized in a logical flow from data input to model deployment.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Notebooks/EDA Layer
    subgraph "Notebooks/EDA"
        A1["Student Performance EDA"] 
        A2["Model Training Notebook"]
    end

    %% Train & Data Pipeline Layer
    subgraph "Train & Data Pipeline"
        TP["Train Pipeline"]
        subgraph "Data Pipeline"
            B1["Data Ingestion"]
            B2["Data Transformation"]
            B3["Model Trainer"]
        end
        TP --> B1
        B1 --> B2
        B2 --> B3
    end

    %% Artifacts Layer
    C["Artifacts"]

    %% Deployment Layer
    D["Predict Pipeline"]

    %% Supporting Infrastructure
    subgraph "Supporting Infrastructure"
        S1["Utilities & Logging"]
        S2["CatBoost Metadata"]
        S3["Documentation & Config"]
    end

    %% Connections across layers
    A1 --> TP
    A2 --> TP
    B3 --> C
    C --> D

    %% Supporting relationships
    TP --- S1
    B3 --- S2
    D --- S3

    %% Click Events
    click A1 "https://github.com/swagath18/comprehensive_regression_model_evaluation_e2e_ml/blob/main/notebook/Student_performance_EDA.ipynb"
    click A2 "https://github.com/swagath18/comprehensive_regression_model_evaluation_e2e_ml/blob/main/notebook/2. MODEL TRAINING.ipynb"
    click TP "https://github.com/swagath18/comprehensive_regression_model_evaluation_e2e_ml/blob/main/src/pipeline/train_pipeline.py"
    click B1 "https://github.com/swagath18/comprehensive_regression_model_evaluation_e2e_ml/blob/main/src/components/data_ingestion.py"
    click B2 "https://github.com/swagath18/comprehensive_regression_model_evaluation_e2e_ml/blob/main/src/components/data_transformation.py"
    click B3 "https://github.com/swagath18/comprehensive_regression_model_evaluation_e2e_ml/blob/main/src/components/model_trainer.py"
    click C "https://github.com/swagath18/comprehensive_regression_model_evaluation_e2e_ml/tree/main/artifacts"
    click D "https://github.com/swagath18/comprehensive_regression_model_evaluation_e2e_ml/blob/main/src/pipeline/predict_pipeline.py"
    click S1 "https://github.com/swagath18/comprehensive_regression_model_evaluation_e2e_ml/blob/main/src/utils.py"
    click S2 "https://github.com/swagath18/comprehensive_regression_model_evaluation_e2e_ml/tree/main/catboost_info"
    click S3 "https://github.com/swagath18/comprehensive_regression_model_evaluation_e2e_ml/blob/main/README.md"

    %% Styles
    classDef eda fill:#b3d9ff,stroke:#0066cc,stroke-width:2px;
    classDef pipeline fill:#ccffcc,stroke:#33cc33,stroke-width:2px;
    classDef artifacts fill:#ffffcc,stroke:#ffcc00,stroke-width:2px;
    classDef supporting fill:#ffcccc,stroke:#ff6666,stroke-width:2px;

    class A1,A2 eda;
    class TP,B1,B2,B3,D pipeline;
    class C artifacts;
    class S1,S2,S3 supporting;
```
