# abhi-105520/sales_prediction architecture

> Architecture diagram of the GitHub repository abhi-105520/sales_prediction, 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/abhi-105520/sales_prediction
- Repository: https://github.com/abhi-105520/sales_prediction

## Overview

##### Main Components
- Data Inputs: Represent the three CSV files as data sources.
- sales.csv – Historical sales data (from 2013 to 2017)
- data_2018.csv & data_2019.csv – New data files for updating predictions
- Data Preprocessing Module: Map the functionality encapsulated in “1_SP_data_preprocessing.ipynb”. This component handles data cleaning, transformation, and extraction of useful information.
- Machine Learning Model Training Module: Represent the “2_SP_model.ipynb” notebook which contains implementations for multiple algorithms (Linear Regression, RandomForest, XGBoost, LSTM Regression).
- Model Evaluation & Comparison Module: Illustrate “3_SP_results.ipynb” where performance of the different models is compared.
- New Data Update Module: Show the “4_SP_newdataupdate.ipynb” notebook which is responsible for uploading and integrating new data (data_2018.csv, data_2019.csv). Stress its irreversible nature as mentioned in the README.

##### Out Relationships and Data Flow
- From the Data Preprocessing Module, indicate that cleansed and transformed data flows into the Model Training Module.
- Within the Model Training Module, include subcomponents or annotations to denote the four algorithm implementations.
- Direct the results (predictions and model outputs) from the Model Training Module into the Model Evaluation & Comparison Module, indicating a performance analysis workflow.

##### Architectural Patterns and Design Principles
- The design represents a linear ML pipeline—from raw data processing through model training and evaluation to eventual data update.
- Modularity: each notebook represents a clear component with well-defined responsibilities.

##### Relevant Technologies and Frameworks
- Since the notebooks are the core of the project, you might note the use of Python and relevant libraries (e.g., scikit-learn, XGBoost, possibly Pandas and NumPy, also libraries for LSTM like TensorFlow or Keras) in your annotations.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Data Sources
    subgraph "Data Sources"
        A["sales.csv"]:::dataSource
        B["data_2018.csv"]:::dataSource
        C["data_2019.csv"]:::dataSource
    end

    %% Processing Modules
    D["1_SP_data_preprocessing.ipynb"]:::preprocessing
    E["2_SP_model.ipynb"]:::training

    %% ML Algorithms inside the Model Training Module
    subgraph "Machine Learning Algorithms"
        F["Linear Regression"]:::training
        G["RandomForest"]:::training
        H["XGBoost"]:::training
        I["LSTM Regression"]:::training
    end

    J["3_SP_results.ipynb"]:::evaluation
    K["4_SP_newdataupdate.ipynb"]:::update

    %% Data Flow Connections (vertical layout)
    A --> D
    B --> D
    C --> D

    D --> E

    E --> F
    E --> G
    E --> H
    E --> I

    F --> J
    G --> J
    H --> J
    I --> J

    %% New Data Update updating historical data permanently
    K -->|"irreversible_update"| A

    %% Click Events for Components
    click A "https://github.com/abhi-105520/sales_prediction/blob/main/sales.csv"
    click B "https://github.com/abhi-105520/sales_prediction/blob/main/data_2018.csv"
    click C "https://github.com/abhi-105520/sales_prediction/blob/main/data_2019.csv"
    click D "https://github.com/abhi-105520/sales_prediction/blob/main/1_SP_data_preprocessing.ipynb"
    click E "https://github.com/abhi-105520/sales_prediction/blob/main/2_SP_model.ipynb"
    click J "https://github.com/abhi-105520/sales_prediction/blob/main/3_SP_results.ipynb"
    click K "https://github.com/abhi-105520/sales_prediction/blob/main/4_SP_newdataupdate.ipynb"

    %% Styles
    classDef dataSource fill:#ADD8E6,stroke:#000,stroke-width:1px;
    classDef preprocessing fill:#90EE90,stroke:#000,stroke-width:1px;
    classDef training fill:#FFA500,stroke:#000,stroke-width:1px;
    classDef evaluation fill:#DDA0DD,stroke:#000,stroke-width:1px;
    classDef update fill:#FF6961,stroke:#000,stroke-width:1px;
```
