Update README.md
Browse files
README.md
CHANGED
|
@@ -1,12 +1,32 @@
|
|
| 1 |
-
#
|
| 2 |
-
This bundle contains a ready-to-run Jupyter notebook, a small synthetic sample dataset, and helper scripts for training ARIMA, LSTM, and Prophet models; evaluating them with rolling-window evaluation; and steps to deploy model artifacts to Hugging Face Hub (you must run that step locally or from an environment with internet access).
|
| 3 |
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
## Quick start
|
| 12 |
1. Create and activate a python environment (recommended: conda or venv)
|
|
@@ -23,11 +43,22 @@ This bundle contains a ready-to-run Jupyter notebook, a small synthetic sample d
|
|
| 23 |
3. The notebook contains cells to download real stock data via `yfinance` (if you have internet) or use the included `sample_stock.csv` for an offline demo.
|
| 24 |
|
| 25 |
## Hugging Face deployment (notes)
|
| 26 |
-
- You cannot deploy directly from this notebook in an environment without internet.
|
| 27 |
- Use `upload_to_hf.py` to push saved model files to the HF repo `DataSynthis_ML_JobTask` after creating it on the Hugging Face website (or the script will create the repo for you if you provide a valid token).
|
| 28 |
- Create a HF token at https://huggingface.co/settings/tokens and set environment variable `HF_TOKEN` or pass `--token` to the script.
|
| 29 |
|
| 30 |
-
##
|
| 31 |
-
|
| 32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
|
|
|
|
| 1 |
+
# π Stock Price Forecasting - DataSynthis ML Job Task
|
|
|
|
| 2 |
|
| 3 |
+
This repository contains implementations of **time-series forecasting** for stock prices using both **traditional statistical models (ARIMA, Prophet)** and **deep learning (LSTM)**.
|
| 4 |
+
The project demonstrates model comparison, rolling-window evaluation, and deployment to Hugging Face Hub.
|
| 5 |
+
|
| 6 |
+
---
|
| 7 |
+
|
| 8 |
+
## Project Overview
|
| 9 |
+
- **Dataset**: Daily stock price dataset (closing prices).
|
| 10 |
+
- **Models Implemented**:
|
| 11 |
+
- ARIMA (AutoRegressive Integrated Moving Average)
|
| 12 |
+
- Prophet (Additive Time Series Forecasting by Meta)
|
| 13 |
+
- LSTM (Long Short-Term Memory Neural Network)
|
| 14 |
+
- **Evaluation**:
|
| 15 |
+
- Rolling-window forecasts
|
| 16 |
+
- Metrics: RMSE, MAPE
|
| 17 |
+
- **Deployment**:
|
| 18 |
+
- Models and results shared on Hugging Face Hub.
|
| 19 |
+
|
| 20 |
+
---
|
| 21 |
+
|
| 22 |
+
## Repository Contents
|
| 23 |
+
- `lstm_model.h5` β Trained LSTM model
|
| 24 |
+
- `scaler.pkl` β Scaler used for preprocessing
|
| 25 |
+
- `performance_summary.csv` β Comparison of ARIMA, Prophet, and LSTM performance
|
| 26 |
+
- `stock_forecasting_notebook.ipynb` β Full notebook with preprocessing, training, evaluation, and plots
|
| 27 |
+
- `upload_to_hf.py` β Script for uploading to Hugging Face Hub
|
| 28 |
+
|
| 29 |
+
---
|
| 30 |
|
| 31 |
## Quick start
|
| 32 |
1. Create and activate a python environment (recommended: conda or venv)
|
|
|
|
| 43 |
3. The notebook contains cells to download real stock data via `yfinance` (if you have internet) or use the included `sample_stock.csv` for an offline demo.
|
| 44 |
|
| 45 |
## Hugging Face deployment (notes)
|
|
|
|
| 46 |
- Use `upload_to_hf.py` to push saved model files to the HF repo `DataSynthis_ML_JobTask` after creating it on the Hugging Face website (or the script will create the repo for you if you provide a valid token).
|
| 47 |
- Create a HF token at https://huggingface.co/settings/tokens and set environment variable `HF_TOKEN` or pass `--token` to the script.
|
| 48 |
|
| 49 |
+
## Results
|
| 50 |
+
|
| 51 |
+
The performance of the three models on stock price forecasting is summarized below:
|
| 52 |
+
|
| 53 |
+
| Model | RMSE | MAPE (%) |
|
| 54 |
+
|---------|--------|----------|
|
| 55 |
+
| ARIMA | 3.3748 | 1.8973 |
|
| 56 |
+
| Prophet | 4.7650 | 3.1859 |
|
| 57 |
+
| LSTM | 2.0890 | 1.2516 |
|
| 58 |
+
|
| 59 |
+
### Key Insights
|
| 60 |
+
- **LSTM** achieved the **lowest RMSE and MAPE**, showing the best accuracy.
|
| 61 |
+
- **ARIMA** performed reasonably well, but less effective with non-linear trends.
|
| 62 |
+
- **Prophet** captured trends and seasonality but had higher errors.
|
| 63 |
+
- Overall, **LSTM is the most reliable model** for this task.
|
| 64 |
|