AP
<AP/>
Back to Portfolio
Open to Opportunities
Explainable ML for Stock Market Volatility
Research · Machine LearningResearch2025

Explainable ML for Stock Market Volatility

6 monthsML Researcher & Lead Developer
PythonXGBoostSHAPScikit-LearnRupturesPandasNumPyMatplotlib
Project Overview

What this project solves.

Academic research project applying XGBoost, SHAP explainability, Ruptures change-point detection, and Scikit-Learn to model dynamic stock market volatility across multiple countries. Focused on interpretable AI and financial forecasting.

⚡Problem

Traditional financial volatility models treat markets as stationary systems with fixed dynamics. In reality, market regimes shift dramatically due to economic crises, policy changes, and geopolitical events — making static models unreliable for real-world forecasting.

🔬Solution

The research applies Ruptures change-point detection to automatically segment market data into distinct regimes, then trains XGBoost models per regime. SHAP values provide full explainability — making it possible to understand exactly which features drive volatility predictions at each point in time.

🚀Impact

The framework outperforms static baseline models and, crucially, provides interpretable explanations that financial analysts can audit and trust — addressing the 'black box' problem that limits AI adoption in regulated financial environments.

Technical Details

Under the hood

✦

Features

  • Automated market regime detection using Ruptures change-point algorithms
  • Per-regime XGBoost volatility forecasting models
  • Full SHAP explainability with feature importance visualisations
  • Multi-country dataset analysis (US, UK, India, Sri Lanka)
  • Comparative benchmark against GARCH and standard ML baselines
  • Interactive visualisation of regime transitions and SHAP waterfall plots
  • Reproducible experiment pipeline with configuration files
◈

Challenges

  • Financial time-series data has complex autocorrelations that violate standard ML train/test split assumptions
  • Choosing the right number of change-points without overfitting to noise in the data
  • Ensuring SHAP values remain consistent and interpretable across different market regimes
  • Handling missing data and different trading calendars across multi-country datasets
◉

Solutions

  • Implemented walk-forward cross-validation with embargo periods to respect temporal ordering
  • Used Bayesian Information Criterion (BIC) to objectively select the optimal number of change-points
  • Computed SHAP values independently per regime model so explanations reflect each market context
  • Built a robust data preprocessing pipeline with forward-fill, calendar alignment, and outlier detection
◆

Lessons Learned

  • Explainability is not optional in finance — it is a prerequisite for model adoption by practitioners
  • Change-point detection fundamentally improves forecasting by acknowledging that markets evolve
  • Walk-forward validation reveals true out-of-sample performance that k-fold cross-validation masks in time series
  • Visualising SHAP values is as important as computing them — communication of results drives impact
Technology Stack

Built with

Python
XGBoost
SHAP
Scikit-Learn
Ruptures
Pandas
NumPy
Matplotlib
More Projects

Keep exploring

Allora.AI

AI Platform · SaaS

Allora.AI

2024·Full Stack Developer
View
Smart Pharmacy Management System

Web App · Healthcare

Smart Pharmacy Management System

2024·Full Stack Developer
View
Automobile Service Management System

Web App · Automotive

Automobile Service Management System

2023·Full Stack Developer
View

© 2026 Abiram Pathmanathan. All rights reserved.

Built with ♥ using Next.js, TypeScript & Framer Motion.