# mp-balaji/deepar-based-resource-recommendation-framework-for-cloud-computing-systems architecture

> Architecture diagram of the GitHub repository mp-balaji/deepar-based-resource-recommendation-framework-for-cloud-computing-systems, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mp-balaji/deepar-based-resource-recommendation-framework-for-cloud-computing-systems
- Repository: https://github.com/mp-balaji/deepar-based-resource-recommendation-framework-for-cloud-computing-systems

## Overview

##### Project Type and Purpose
- Type: It is essentially a data modeling and forecasting project with a focus on time series analysis for CPU usage.

##### File Structure
- File tree highlights:
- Dataset Script: dataset.sh – fetches CPU workload data.
- Feature Engineering: feature_engineering.py – cleans and augments the dataset.
- Forecasting Models: baseline_arima.py, baseline_lstm.py, and deepar_modelling.py – each represents a different modeling technique.
- Data Artifact: df_scaled.csv – serves as a key input/output artifact between processes.
- Output: The output folder contains various plots and visualizations generated by these scripts.
- These files clearly indicate a pipeline separation where the dataset is first fetched, then processed (feature engineering), and subsequently used in different prediction models.

##### Main Components
- Data Ingestion & Extraction:
- Component: dataset.sh
- Role: Downloading and extracting the dataset.
- Data Preprocessing & Feature Engineering:
- Component: feature_engineering.py
- Role: Combining CSV files, adding relevant time components/features, and performing stationarity tests.
- Modeling and Prediction:
- Component: baseline_arima.py for ARIMA modeling.
- Component: baseline_lstm.py for LSTM model forecasting.
- Component: deepar_modelling.py for deploying DeepAR using AWS SageMaker.
- Data Artifacts:
- File: df_scaled.csv acts as the connection between the feature engineering stage and the modeling stages.
- Visualization and Output:
- Directory: output stores the generated plots (CPU usage visualizations, anomaly detection plots, etc.).

##### Relationships and Interactions
- Flow:
- The process begins with data ingestion (dataset.sh) and then moves to feature engineering (feature_engineering.py) which outputs df_scaled.csv.
- df_scaled.csv is then consumed by each model script (arima, lstm, and deepar) to generate predictions.
- Each of these scripts produces visual outputs (plots) saved to the output folder.

##### Architectural Patterns and Design Principles
- The project follows a modular pipeline design where each stage of data processing is encapsulated in its own script.
- Data flow separation; feature engineering is decoupled from modeling, and each modeling approach is implemented in a separate module.
- Notice the integration between local execution (support for local paths) versus deployment environments (Google Colab, AWS SageMaker) which shows an abstraction for handling different runtime environments.

##### Specific Technologies/Frameworks
- Data Libraries: numpy, pandas, matplotlib, seaborn, statsmodels, and scikit-learn.
- Deep Learning Framework: keras for LSTM.
- AWS SageMaker: For running the DeepAR model.
- Deployment/Execution: Instructions for Google Colab and local environments indicate additional dependency layers.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Data Pipeline
    subgraph "Data Pipeline"
        datasetnode("dataset.sh"):::script
        fe_node("feature_engineering.py"):::script
        artifact_node("df_scaled.csv"):::data
    end

    datasetnode -->|"process"| fe_node
    fe_node -->|"outputs"| artifact_node

    %% Modeling Engines
    subgraph "Modeling"
        arima_node("baseline_arima.py"):::model
        lstm_node("baseline_lstm.py"):::model
        deepar_node("deepar_modelling.py"):::cloud
    end

    artifact_node -->|"consumed_by"| arima_node
    artifact_node -->|"consumed_by"| lstm_node
    artifact_node -->|"consumed_by"| deepar_node

    %% Visualization & Output
    output_node("output"):::data

    arima_node -->|"visualizes"| output_node
    lstm_node -->|"visualizes"| output_node
    deepar_node -->|"visualizes"| output_node

    %% Click Events
    click datasetnode "https://github.com/mp-balaji/deepar-based-resource-recommendation-framework-for-cloud-computing-systems/blob/master/dataset.sh"
    click fe_node "https://github.com/mp-balaji/deepar-based-resource-recommendation-framework-for-cloud-computing-systems/blob/master/feature_engineering.py"
    click artifact_node "https://github.com/mp-balaji/deepar-based-resource-recommendation-framework-for-cloud-computing-systems/blob/master/df_scaled.csv"
    click arima_node "https://github.com/mp-balaji/deepar-based-resource-recommendation-framework-for-cloud-computing-systems/blob/master/baseline_arima.py"
    click lstm_node "https://github.com/mp-balaji/deepar-based-resource-recommendation-framework-for-cloud-computing-systems/blob/master/baseline_lstm.py"
    click deepar_node "https://github.com/mp-balaji/deepar-based-resource-recommendation-framework-for-cloud-computing-systems/blob/master/deepar_modelling.py"
    click output_node "https://github.com/mp-balaji/deepar-based-resource-recommendation-framework-for-cloud-computing-systems/tree/master/output"

    %% Styles
    classDef script fill:#f2b880,stroke:#333,stroke-width:2px;
    classDef data fill:#a7d3a9,stroke:#333,stroke-width:2px;
    classDef model fill:#ccf2ff,stroke:#333,stroke-width:2px;
    classDef cloud fill:#ffd1dc,stroke:#333,stroke-width:2px;
```
