https://github.com/gaurav0502/daily-sales-forecasting
Forecasting daily total sales ๐งพ of different gifting items ๐ using holiday data ๐, promotional sales data ๐ท๏ธ , and other time-series features ๐.
https://github.com/gaurav0502/daily-sales-forecasting
deepar forecasting nhits python pytorch ray seaborn temporal-fusion-transformer tensorflow tft
Last synced: 20 days ago
JSON representation
Forecasting daily total sales ๐งพ of different gifting items ๐ using holiday data ๐, promotional sales data ๐ท๏ธ , and other time-series features ๐.
- Host: GitHub
- URL: https://github.com/gaurav0502/daily-sales-forecasting
- Owner: Gaurav0502
- Created: 2025-03-30T22:05:23.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2025-05-10T05:44:08.000Z (25 days ago)
- Last Synced: 2025-05-10T06:27:09.624Z (25 days ago)
- Topics: deepar, forecasting, nhits, python, pytorch, ray, seaborn, temporal-fusion-transformer, tensorflow, tft
- Language: Python
- Homepage:
- Size: 1.87 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
Awesome Lists containing this project
README
Daily Sales Forecasting
## Aim
To forecast the daily sales of products with the holiday and promotional sales information. This information includes:
1. Holiday Features (Christmas, is_weekend, is_holiday, days_to_christmas)
2. Promotional Sales (Easter sale, Back to School sale, Black Friday sales, and Boxing Day sale)
3. Time-series Features (7-day lag, 7-day rolling mean)
## Environment Setup
- Clone this repository.
```bash
git clone https://github.com/Gaurav0502/daily-sales-forecasting.git
```
- Install all packages in the ```requirements.txt``` file.
```bash
pip install -r requirements.txt
```
- Download and store all the three datasets from following sources:
1. Online retail dataset: https://archive.ics.uci.edu/dataset/352/online+retail
2. Clusters and Event dataset: https://www.kaggle.com/datasets/gauravpendharkar/cluster-and-events-data
- The following directory structure is required for the code in this repository to work properly:
```bash
.
โโโ data
โย ย โโโ clusters
โย ย โย ย โโโ cluster_0.csv
โย ย โย ย โโโ cluster_1.csv
โย ย โย ย โโโ cluster_2.csv
โย ย โย ย โโโ cluster_3.csv
โย ย โย ย โโโ cluster_4.csv
โย ย โย ย โโโ cluster_5.csv
โย ย โย ย โโโ cluster_6.csv
โย ย โย ย โโโ cluster_7.csv
โย ย โย ย โโโ cluster_8.csv
โย ย โย ย โโโ cluster_9.csv
โย ย โโโ events.json
โย ย โโโ online_retail_II.xlsx
โโโ dataprocessor.py
โโโ deepar
โย ย โโโ config.py
โย ย โโโ deepar.py
โโโ evaluator.py
โโโ modelling.ipynb
โโโ nhits
โย ย โโโ configs.py
โย ย โโโ nhits.py
โโโ README.md
โโโ requirements.txt
โโโ sales_holidays.py
โโโ setup.sh
โโโ tft
โย ย โโโ configs.py
โย ย โโโ tft.py
โย ย โโโ tuner.py
```## Results
| Model | Overall MAPE | Model Complexity | Dashboard |
|--------------|--------------|--------------|--------------|
| TFT | 21.70 | 0.2 | [wandb](https://wandb.ai/gauravpendharkar/TFT%20Window-based%20Evaluation?nw=nwusermitugaurav15) |
| NHiTS | 18.70 | 0.2 | [wandb](https://wandb.ai/gauravpendharkar/NHiTS%20Window-based%20Evaluation/workspace?nw=nwusermitugaurav15) |
| DeepAR | 19.51 | 0.2 | [wandb](https://wandb.ai/gauravpendharkar/DeepAR%20Window%20based%20evaluation/overview) |where:
$$ \text{Model Complexity} = \frac{\text{Number of Models}}{\text{Number of Clusters}} $$
## References
Online Retail dataset: https://archive.ics.uci.edu/dataset/502/online+retail+ii
Demand Forecasting using TFT: https://pytorch-forecasting.readthedocs.io/en/stable/tutorials/stallion.html
Autoregressive modelling with DeepAR and DeepVAR: https://pytorch-forecasting.readthedocs.io/en/stable/tutorials/deepar.html