|
Download README.md from saif05/DataSynthis_Job_task: direct link, hf CLI and curl.
- Browser
- Download file 3.08 kB
-
https://huggingface.co/saif05/DataSynthis_Job_task/resolve/main/README.md
- Command line
-
hf download hf://saif05/DataSynthis_Job_task/README.md
-
curl -L -o README.md https://huggingface.co/saif05/DataSynthis_Job_task/resolve/main/README.md
3.08 kB
| # π Time Series Forecasting β Stock Prices | |
| This project demonstrates how to perform **time series forecasting** on stock prices using both **statistical models** (ARIMA, SARIMAX) and **deep learning (LSTM)**, with proper evaluation techniques like **rolling window forecasting**. | |
| --- | |
| ## π Project Overview | |
| The notebook walks through the end-to-end pipeline of forecasting stock prices: | |
| 1. **Dataset Acquisition** | |
| - Uses the Kaggle dataset: *World Stock Prices β Daily Updating* | |
| - Downloaded via `kagglehub` | |
| 2. **Preprocessing** | |
| - Convert `Date` column to datetime and set as index. | |
| - Sort data by date. | |
| - Filter for a single stock (default: **AAPL**). | |
| - Handle missing values using forward-fill / interpolation. | |
| 3. **Exploratory Data Analysis (EDA)** | |
| - Visualize stock closing prices over time. | |
| - Check for stationarity (ADF test). | |
| - Plot ACF/PACF to guide ARIMA orders. | |
| 4. **Modeling Approaches** | |
| - **ARIMA**: Baseline forecasting with manually selected parameters. | |
| - **Auto-ARIMA**: Automated parameter tuning using AIC/BIC. | |
| - **SARIMAX**: Seasonal ARIMA with exogenous variables (optional). | |
| - **LSTM**: Deep learning model for sequence prediction. | |
| 5. **Forecast Evaluation** | |
| - Implement **rolling window forecasting**: | |
| - Train on initial window β Forecast one step ahead β Update with true value β Repeat. | |
| - Evaluate models using metrics: | |
| - RMSE, MAE, MAPE | |
| --- | |
| ## βοΈ Installation & Requirements | |
| Install dependencies: | |
| ```bash | |
| pip install pandas numpy matplotlib seaborn scikit-learn statsmodels pmdarima tensorflow kagglehub | |
| ``` | |
| If running in **Google Colab**, you may also need: | |
| ```bash | |
| pip install kagglehub | |
| ``` | |
| --- | |
| ## π Usage | |
| 1. Clone or download the notebook: | |
| ```bash | |
| git clone <repo-link> | |
| cd stock-forecasting | |
| ``` | |
| 2. Run the Jupyter Notebook: | |
| ```bash | |
| jupyter notebook "Time_Series_Forecasting_β_Stock_Prices.ipynb" | |
| ``` | |
| 3. Inside the notebook: | |
| - Change the stock ticker (`ticker_symbol = 'AAPL'`) to forecast other stocks. | |
| - Choose between **ARIMA / SARIMAX / LSTM** sections. | |
| - Run evaluation cells to compare results. | |
| --- | |
| ## π Results | |
| - **ARIMA** works well for short-term stationary series. | |
| - **SARIMAX** captures seasonality but is computationally heavier. | |
| - **LSTM** adapts to nonlinear patterns, showing better performance for long-term forecasts. | |
| - Rolling window evaluation provides realistic performance assessment compared to a single train-test split. | |
| --- | |
| ## π Key Files | |
| - `Time_Series_Forecasting_β_Stock_Prices.ipynb` β Main notebook with full workflow | |
| - `world_stock_prices_2_years.csv` β Example filtered dataset for a single stock | |
| --- | |
| ## β¨ Future Improvements | |
| - Add Prophet model for easier seasonality handling. | |
| - Incorporate financial indicators (RSI, MACD) as exogenous features. | |
| - Deploy as a web dashboard with live forecasts. | |
| --- | |
| ## π License | |
| This project is for educational and research purposes only. Not financial advice. | |