Predicting Stock Volatility Risk from Price and Sentiment
A model that classifies a stock's coming week as Low, Medium, or High volatility from price history and news-sentiment features — built primarily to answer one question through a controlled experiment: does the sentiment signal actually improve the prediction?
Try it in your browser →
Runs on your device — nothing is uploaded.
A native application running the same on-device model as the browser demonstration — offline, with no data uploaded.
Download APK →Installation (sideloading)
- On an Android phone, open this page and tap Download APK.
- When prompted, permit your browser to install from unknown sources (Android requests this once, for safety).
- Open the downloaded file and tap Install.
Educational application — not financial advice and not a recommendation. Distributed outside the Play Store and signed with a debug key, so Android displays a warning before installation; this is expected for a sideloaded educational build. Built for arm64 devices. Android only at present — an iOS build can be produced from the same codebase.
Summary
| Task | Classify a stock's next-week realized volatility as Low / Medium / High |
|---|---|
| Dataset | Yahoo Finance prices + ticker-level news sentiment (Polygon, 2023), 59 stocks |
| Features | 12: trailing returns, rolling volatility, volume, drawdown, and a daily sentiment signal |
| Model | Compact multilayer perceptron — 3,397 parameters (20 KB) |
| Result | 57% accuracy on 3 classes (chance is 33%) — see the sentiment ablation below |
| Deployment | ONNX in the browser demonstration; TensorFlow Lite in the Android application |
Volatility rather than direction
Predicting whether a stock rises or falls tomorrow is close to a coin flip. Predicting how much it will move — its volatility — is more tractable, because volatility clusters: calm periods tend to follow calm periods and turbulent ones follow turbulent ones. This temporal autocorrelation is genuine, learnable signal, which is why a simple model reaches 57% on a three-class problem where chance is 33%.
Training progression
The model trains in seconds and settles near 59% on a proper temporal validation window (the latest weeks of the training period), then 57% on the later, unseen test period — a small, honest gap that occurs when the market enters a regime the model has not observed.
The central result: sentiment did not improve performance
Because the project centers on the sentiment signal, the decisive result is the controlled comparison. Training an identical model on price features only — no sentiment — yielded 57.5%, marginally higher than the 57.1% obtained with sentiment included. The sentiment signal added no predictive value, and if anything a small amount of noise.
This is neither a defect nor a disappointment; it is the most valuable finding of the project. A daily average of headline sentiment is a coarse, sparse signal, and once rolling-volatility features are present, most of what is predictable about next week's turbulence is already captured. Reporting the negative result — rather than omitting the ablation and claiming sentiment "works" — is what distinguishes an experiment from a demonstration.
Error analysis
The errors fall where expected: the model reads calm weeks (Low, 75% recall) and turbulent weeks (High, 57%) reasonably well, but the Medium class is difficult (33%), because intermediate volatility sits on a blurred boundary between the other two. This is an interpretable failure mode rather than a mysterious one.
Next iteration (v2)
For sentiment to earn its place it must be richer than a daily average: per-headline embeddings rather than a single number, a longer multi-year history spanning additional market regimes, and a test of whether sentiment contributes more to direction prediction than to volatility. Those results will appear in the table above — including, honestly, if sentiment still does not help.