Lightweight Python + data-engineering project for exploring VIX prediction with a simple baseline model and Snowflake-backed data flow.
Maintainer: OceanicPatterns Repository: https://github.com/oceanicpatterns/VIX-Index-Prediction-Model
- Why This Project Exists
- Quick Navigation
- Background: VIX in Plain English
- Architecture and Data Flow
- Interactive Demo Playground
- Quick Start
- Configuration and Security
- Run the Model
- Run Tests
- CI and Quality Gates
- Project Structure
- Limitations and Next Steps
This repository demonstrates a clean, testable workflow for:
- Retrieving VIX historical data.
- Building a derived volatility feature.
- Persisting and reading modeled data through Snowflake.
- Training and evaluating a baseline regression model.
It is designed as an educational baseline with production-minded engineering practices (typed contracts, tests, CI, secret hygiene).
- App orchestration:
src/vix_model/app.py - Core modeling logic:
src/vix_model/modeling.py - Snowflake and config boundary:
src/vix_model/snowflake_io.py - Unit tests:
tests/test_modeling.py,tests/test_snowflake_io.py - Local static demo:
docs/playground.html - Demo entry for GitHub Pages:
docs/index.html - CI workflows:
The VIX (CBOE Volatility Index) is often called the market's "fear gauge." It reflects expected near-term volatility derived from S&P 500 options pricing.
In this project, the engineered feature is:
VOLATILITY_INDEX = (HIGH - LOW) / CLOSE
This is a simplified signal and not a complete market-volatility model. The goal here is to provide a transparent baseline pipeline, not trading advice.
- Fetch CSV data from CBOE endpoint.
- Validate expected input columns.
- Compute
VOLATILITY_INDEX. - Write/read data via Snowflake temp table.
- Train/test split.
- Fit linear regression.
- Report MSE and sample prediction.
- Domain modeling:
modeling.py - Persistence + credentials:
snowflake_io.py - Runtime orchestration:
app.py - Backward compatibility shims:
Use the static visitor demo to explore the project quickly:
- Live root URL: https://oceanicpatterns.github.io/VIX-Index-Prediction-Model/
- Live direct demo: https://oceanicpatterns.github.io/VIX-Index-Prediction-Model/playground.html
- Local file:
docs/playground.html
Run locally:
open docs/playground.htmlpython3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
pytest -q
python ml_vix_model.pySecrets are not committed to source control.
export SNOWFLAKE_USER="..."
export SNOWFLAKE_PASSWORD="..."
export SNOWFLAKE_ACCOUNT="..."
export SNOWFLAKE_WAREHOUSE="..."
export SNOWFLAKE_DATABASE="..."
export SNOWFLAKE_SCHEMA="..."Optional:
export SNOWFLAKE_TEMP_TABLE="MASTER_DB.RAW.TEMP_TABLE"
export VIX_PREDICTION_INPUT="0.40"cp config/snowflake_config.example.ini config/snowflake_config.iniThen fill local credentials in config/snowflake_config.ini (ignored by git).
python ml_vix_model.pypip install .
run_vix_modelpytest -qRUN_SNOWFLAKE_INTEGRATION_TESTS=1 pytest -qOn every push/PR:
- Secret scan (
gitleaks) - Python syntax check
- Unit tests
Manual runs are enabled with workflow_dispatch.
VIX-Index-Prediction-Model/
src/
vix_model/
__init__.py
app.py
modeling.py
snowflake_io.py
tests/
test_modeling.py
test_snowflake_io.py
docs/
index.html
playground.html
config/
snowflake_config.example.ini
ml_vix_model.py
snowflake_connection.py
pytest.ini
requirements.txt
setup.py
LICENSE
- Current model is intentionally simple (single-feature linear regression).
- No feature store or experiment tracking yet.
- No advanced time-series modeling in current baseline.
Natural next extensions:
- Add richer feature engineering (lags, rolling stats, macro signals).
- Add model comparison (
LinearRegression, tree models, regularized models). - Add data versioning and experiment logs.
- Add model serving or batch prediction output contracts.
This repository is educational and not financial advice.