Skip to content

A Streamlit dashboard for multivariate stock forecasting using Close and Volume. Supports three model options: XGBoost, Prophet, and SARIMAX.

Notifications You must be signed in to change notification settings

TnMarty2/Stocks_data

Repository files navigation

Multivariate Stock Forecast Dashboard (Close + Volume)

A Streamlit dashboard for multivariate stock forecasting using Close and Volume.
Supports three model options: XGBoost, Prophet, and SARIMAX. The project includes robust preprocessing (handling MultiIndex columns from yfinance, datetime normalization, dtype sanitization), lag & rolling feature engineering, recursive multi-step forecasting for tree models, and defensive code to handle common runtime issues.

Contents

  • app.py / r1_ui_forecast.py — main Streamlit script (replace with your script name)
  • utility modules or functions:
    • feature engineering (lags, rolling stats)
    • model wrappers for XGBoost, Prophet, SARIMAX
  • requirements.txt — Python dependencies

Features

  • Streamlit UI to choose ticker, date range, model, and forecast horizon.
  • Multivariate modeling:
    • XGBoost: lag & rolling features, recursive multi-step forecasting, GridSearch with safeguards on small datasets.
    • Prophet: Volume used as regressor (if provided).
    • SARIMAX: Volume used as exogenous variable.
  • Robust input handling:
    • Auto-detect & normalize Date, Close, Volume columns (handles MultiIndex / tuple column names).
    • Convert datetime to numeric (ordinal/dayofweek) or engineered features.
    • Sanitize predictions and arrays to ensure 1-D shapes for metrics.
  • Defensive GridSearch usage — reduces/avoids heavy tuning on small datasets.
  • Visualizations: holdout vs predicted, historical + forecast combined chart.

Quick start

  1. Clone repository
git clone https://github.com/<your-username>/multivariate-stock-forecast.git
cd multivariate-stock-forecast
  1. Create & activate virtual environment (recommended) macOS / Linux:
python -m venv .venv
source .venv/bin/activate

Windows (PowerShell):

python -m venv .venv
.venv\Scripts\Activate.ps1
  1. Install dependencies
pip install -r requirements.txt

If you experience issues installing Prophet on Windows, try using conda:

conda install -c conda-forge prophet
  1. Run the app
streamlit run r1_ui_forecast.py

About

A Streamlit dashboard for multivariate stock forecasting using Close and Volume. Supports three model options: XGBoost, Prophet, and SARIMAX.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published