# sifat192/amazon-stock-forecasting-pytorch architecture

> Architecture diagram of the GitHub repository sifat192/amazon-stock-forecasting-pytorch, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sifat192/amazon-stock-forecasting-pytorch
- Repository: https://github.com/sifat192/amazon-stock-forecasting-pytorch

## Overview

This is an educational stock-price forecasting workflow, not a reusable application or service. A user runs the EDA notebook to inspect historical prices and export the closing-price series, then runs the forecasting notebook to prepare chronological train/test sequences, fit an LSTM, and evaluate it against a previous-close baseline. The README documents these responsibilities and file handoffs; notebook source was not available for inspection, so internal implementation details are limited to those documented stages.

Main entry points: [`01_eda.ipynb`](https://github.com/sifat192/amazon-stock-forecasting-pytorch/blob/main/01_eda.ipynb) (Explore and export), [`02_lstm_forecasting.ipynb`](https://github.com/sifat192/amazon-stock-forecasting-pytorch/blob/main/02_lstm_forecasting.ipynb) (Sequence preparation), [`Amazon_stock_closing_prices.csv`](https://github.com/sifat192/amazon-stock-forecasting-pytorch/blob/main/Amazon_stock_closing_prices.csv) (Closing-price series), [`AMZN.csv`](https://github.com/sifat192/amazon-stock-forecasting-pytorch/blob/main/AMZN.csv) (Historical prices)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_exploration["Data Exploration"]
  node_eda["Explore and export<br/>[01_eda.ipynb]"]
  node_raw_data["Historical prices<br/>[AMZN.csv]"]
  node_close_series["Closing-price series"]
end

subgraph group_forecasting["Forecasting"]
  node_sequence_prep["Sequence preparation"]
  node_split_scale["Chronological split and scaling"]
  node_lstm["LSTM training"]
end

subgraph group_evaluation["Evaluation"]
  node_evaluation["Prediction evaluation"]
end

node_user(("Notebook user"))

node_user -->|"runs first"| node_eda
node_eda -->|"reads"| node_raw_data
node_eda -->|"exports"| node_close_series
node_user -->|"runs next"| node_sequence_prep
node_close_series -->|"provides prices"| node_sequence_prep
node_sequence_prep -->|"builds examples"| node_split_scale
node_split_scale -->|"provides scaled data"| node_lstm
node_lstm -->|"provides predictions"| node_evaluation

click node_eda "https://github.com/sifat192/amazon-stock-forecasting-pytorch/blob/main/01_eda.ipynb"
click node_raw_data "https://github.com/sifat192/amazon-stock-forecasting-pytorch/blob/main/AMZN.csv"
click node_close_series "https://github.com/sifat192/amazon-stock-forecasting-pytorch/blob/main/Amazon_stock_closing_prices.csv"
click node_sequence_prep "https://github.com/sifat192/amazon-stock-forecasting-pytorch/blob/main/02_lstm_forecasting.ipynb"
click node_split_scale "https://github.com/sifat192/amazon-stock-forecasting-pytorch/blob/main/02_lstm_forecasting.ipynb"
click node_lstm "https://github.com/sifat192/amazon-stock-forecasting-pytorch/blob/main/02_lstm_forecasting.ipynb"
click node_evaluation "https://github.com/sifat192/amazon-stock-forecasting-pytorch/blob/main/02_lstm_forecasting.ipynb"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_eda,node_raw_data,node_close_series,node_user toneBlue
class node_sequence_prep,node_split_scale,node_lstm toneAmber
class node_evaluation toneMint
```

## Components

### Data Exploration

- [Explore and export](https://github.com/sifat192/amazon-stock-forecasting-pytorch/blob/main/01_eda.ipynb): `01_eda.ipynb`
- [Historical prices](https://github.com/sifat192/amazon-stock-forecasting-pytorch/blob/main/AMZN.csv): `AMZN.csv`
- [Closing-price series](https://github.com/sifat192/amazon-stock-forecasting-pytorch/blob/main/Amazon_stock_closing_prices.csv): `Amazon_stock_closing_prices.csv`

### Forecasting

- [Sequence preparation](https://github.com/sifat192/amazon-stock-forecasting-pytorch/blob/main/02_lstm_forecasting.ipynb): `02_lstm_forecasting.ipynb`
- [Chronological split and scaling](https://github.com/sifat192/amazon-stock-forecasting-pytorch/blob/main/02_lstm_forecasting.ipynb): `02_lstm_forecasting.ipynb`
- [LSTM training](https://github.com/sifat192/amazon-stock-forecasting-pytorch/blob/main/02_lstm_forecasting.ipynb): `02_lstm_forecasting.ipynb`

### Evaluation

- [Prediction evaluation](https://github.com/sifat192/amazon-stock-forecasting-pytorch/blob/main/02_lstm_forecasting.ipynb): `02_lstm_forecasting.ipynb`

### Other components

- **Notebook user**

## Connections

- Notebook user → Explore and export: runs first (evidence: `README.md`)
- Explore and export → Historical prices: reads (evidence: `README.md`)
- Explore and export → Closing-price series: exports (evidence: `README.md`)
- Notebook user → Sequence preparation: runs next (evidence: `README.md`)
- Closing-price series → Sequence preparation: provides prices (evidence: `README.md`)
- Sequence preparation → Chronological split and scaling: builds examples (evidence: `README.md`)
- Chronological split and scaling → LSTM training: provides scaled data (evidence: `README.md`)
- LSTM training → Prediction evaluation: provides predictions (evidence: `README.md`)
