# mehrdat/data_science_project architecture

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

- Interactive diagram: https://gitdiagram.com/mehrdat/data_science_project
- Repository: https://github.com/mehrdat/data_science_project

## Overview

##### Main Components
- Data Collection: Represent the process of gathering historical stock data. Although the current files include a CSV (data.csv) and the README discusses automated data collection with yfinance, indicate that this module is responsible for interfacing with Yahoo Finance’s API.
- Data Storage: Show where the raw and/or preprocessed data is stored (the CSV file in this case).
- Data Processing & Feature Engineering: Indicate the preprocessing steps such as time-series decomposition, normalization, and missing value handling. This will involve Python libraries like pandas and scikit-learn.
- Model Evaluation: Add a component that computes metrics (RMSE, MAE, MAPE) to compare model performance.
- Visualization & Reporting: Illustrate that the outputs (predicted vs. actual prices) are visualized using tools like matplotlib and plotly, and possibly interacted with via the notebook interface.

##### Relationships and Data Flow
- Additionally, include a note indicating that the Jupyter Notebook (proj.ipynb) serves as an interactive hub that orchestrates these steps.

##### Architectural Patterns & Design Principles
- Modularity by clearly isolating data ingestion, processing, model computation, and visualization.
- The design essentially follows a pipeline pattern – each stage (collection, processing, modeling, evaluation, reporting) feeds into the next.
- Separation of concerns is paramount so that if a model or processing step needs to be changed, it does not affect the remaining parts.

##### Technologies, Frameworks, and Libraries
- Mention Python libraries such as pandas, numpy, and scikit-learn in the data processing block.
- For deep learning models, list TensorFlow and PyTorch as relevant technologies.
- Data collection leverages yfinance as the API.
- For visualization, include matplotlib and plotly as key libraries.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Data Pipeline"
        DC["Data Collection (Yahoo Finance API)"]:::external
        DS["Data Storage (CSV)"]:::database
        DP["Data Processing & Feature Engineering"]:::processing
    end

    subgraph "Forecasting & Evaluation"
        FM["Forecasting Models (ARIMA, LSTM, BiLSTM, N-BEATS, DeepAR, Prophet, TCN)"]:::modeling
        ME["Model Evaluation (Metrics: RMSE, MAE, MAPE)"]:::evaluation
        VR["Visualization & Reporting (Predicted vs.Actual Prices)"]:::visualization
    end

    Hub["Jupyter Notebook (Interactive Hub)"]:::hub

    DC -->|"CollectData"| DS
    DS -->|"StoreData"| DP
    DP -->|"PreprocessedData"| FM
    FM -->|"GeneratePredictions"| ME
    ME -->|"EvaluateModels"| VR

    Hub --- DC
    Hub --- DP
    Hub --- FM
    Hub --- ME
    Hub --- VR

    click DC "https://github.com/mehrdat/data_science_project/blob/main/proj.ipynb"
    click DS "https://github.com/mehrdat/data_science_project/blob/main/data.csv"
    click DP "https://github.com/mehrdat/data_science_project/blob/main/proj.ipynb"
    click FM "https://github.com/mehrdat/data_science_project/blob/main/proj.ipynb"
    click ME "https://github.com/mehrdat/data_science_project/blob/main/proj.ipynb"
    click VR "https://github.com/mehrdat/data_science_project/blob/main/proj.ipynb"
    click Hub "https://github.com/mehrdat/data_science_project/blob/main/proj.ipynb"

    classDef external fill:#ccf,stroke:#333,stroke-width:2px;
    classDef database fill:#cfc,stroke:#333,stroke-width:2px;
    classDef processing fill:#fc9,stroke:#333,stroke-width:2px;
    classDef modeling fill:#f9c,stroke:#333,stroke-width:2px;
    classDef evaluation fill:#cff,stroke:#333,stroke-width:2px;
    classDef visualization fill:#9cf,stroke:#333,stroke-width:2px;
    classDef hub fill:#ddd,stroke:#333,stroke-width:2px,stroke-dasharray: 5 5;
```
