Mika Ismayilli
← Back to work
Live

BeatTheStreet

A full-stack ML application that predicts quarterly earnings surprises (beat / meet / miss) for US public companies, trained on 104,938 earnings observations spanning 2005–2024.

0.0%
Test accuracy
0
Earnings obs.
0–2024
Data span
0
Feature groups
LightGBMscikit-learnSHAPFastAPIReactTypeScriptViteTailwindDockerWRDSFRED
Live demo ↗GitHub 1 ↗GitHub 2 ↗

The problem

Earnings surprises — a company reporting results above or below analyst consensus — drive some of the largest single-day stock price moves. Existing research shows that these surprises are partially predictable from publicly available data: analyst estimate revisions, momentum, and fundamentals all carry signal. But most academic work stays in research notebooks. I wanted to build something end-to-end: from raw financial databases to a live, explainable product a user could actually interact with.

The benchmark I chose to beat was the “always-beat” classifier — simply predicting that every company beats every quarter. On the 2022–2024 test set, that baseline hit 47.8%. My target was to meaningfully exceed that with a model that was honest about its uncertainty and explainable at the individual-prediction level.

The approach

The data pipeline pulls from four source groups via WRDS:

  • Analyst estimates and actuals (I/B/E/S) — consensus EPS, estimate revisions, analyst count, forecast dispersion
  • Company fundamentals (Compustat) — earnings quality metrics, accruals, sales growth, gross margin
  • Price and momentum (CRSP) — 1-month and 3-month returns, volatility, volume trends
  • Macroeconomic context (FRED) — fed funds rate, credit spreads, VIX at announcement date

All features were joined on a strict time-based basis to prevent lookahead bias. The train/validation/test split was 2005–2019 / 2020–2021 / 2022–2024 — no shuffling, no cross-validation across time. Preprocessing applied 1st/99th percentile winsorization and median imputation before fitting.

A news sentiment layer was added via VADER scoring on yfinance-pulled headlines around each earnings announcement, giving the model a real-time qualitative signal.

The final model is LightGBM, tuned on the validation set. Every prediction surfaces a SHAP breakdown showing exactly which features pushed the model toward its answer — so users can see whether the model is relying on analyst revisions, price momentum, or macro conditions.

BeatTheStreet live prediction for NVDA: beat with 87.5% confidence, with beat, meet, and miss probability bars and a note that 21 of 27 features were available live.
Live prediction · NVDA, pulled from the deployed app · 21 of 27 features available live, the rest imputed with training medians
SHAP contribution bars for the NVDA prediction: revenue growth, return on assets, and analyst count push toward beat; accruals and stock price push against.
SHAP contributions for the same prediction · green pushes toward the predicted class, red against · raw feature value under each name

What I found

  • 60.9% test accuracy on the 2022–2024 holdout — a 13.1-percentage-point lift over the always-beat baseline.
  • The strongest predictors were analyst estimate revision direction and magnitude, followed by recent price momentum and earnings quality (accruals).
  • VADER sentiment on pre-announcement headlines added a small but consistent signal, most visible in the miss bucket.
  • The model calibrates well on beat vs. miss but is less confident on the narrow 'meet' bucket — which reflects genuine difficulty in the data.

What I'd do differently

  • Ensemble stacking: combine LightGBM with a logistic regression baseline and a small neural net head, then stack with a meta-learner.
  • Backtest a long/short trading strategy built on the predictions — the natural next step from a prediction to a decision.
  • Add more granular I/B/E/S revision timing: not just whether analysts revised, but how far from the announcement date.
  • Explore multi-task learning across the beat/meet/miss classes to reduce the class-imbalance problem in the meet bucket.