StockAI Terminal
An earlier exploration: an ML + LLM prototype that predicts a single stock's direction — AdaBoost signals validated on a chronological split with a 30-day embargo, explained by an LLM fed structured model output so it cites rather than hallucinates, and never gives buy/sell advice. The direction-prediction approach is the one I later measured as a dead end and superseded with RankAlpha's cross-sectional ranking; it is kept here because that failure is what forced the better design.
- AdaBoost
- Chronological split + embargo
- Llama 3.3 · Groq
- GitHub Actions
- Streamlit
What it is
StockAI Terminal is an end-to-end ML + LLM prototype for stock analysis, and an earlier step in a line of work that has since moved on. I want to be precise about that word prototype: it was never a production system. The value is in the explainability and the grounded LLM layer, not in the raw prediction accuracy.
It asks "will this stock go up?" — direction prediction on one stock from its own features. That framing is the one I later measured properly and found wanting, and replacing it is what RankAlpha exists to do.
The model
The signal model is AdaBoost, evaluated with walk-forward validation — train on the past, test on the next window, roll forward — across 31 stocks, 4 sectors, ~10 years, and roughly 74,000 datapoints.
Accuracy lands around 57%. I'm stating that plainly because it's the honest number: a few points above a coin flip on a genuinely hard problem. The point of the project isn't to beat the market — it's to make the model's reasoning legible.
What the model learned
The feature importances are the interesting part:
- —Volatility — 41.7%
- —PE ratio — 17.7%
- —MACD histogram — 16.9%
- —RSI — roughly 0%
Volatility dominates, while the much-loved RSI contributes essentially nothing. Surfacing that kind of finding is exactly what the explainability layer is for.
The LLM layer
A Llama 3.3 70B model, served via Groq, turns the model output into a readable analysis. Crucially, it's fed the structured model output — the predictions and feature importances — so it cites those numbers rather than hallucinating its own.
It never gives buy or sell advice. It explains what the model saw and why, and stops there.
Automation
The model retrains weekly via GitHub Actions, so the terminal stays current without manual intervention.
Where it led
The 57% is the whole story in hindsight. I took the same question into RankAlpha, audited it properly, and found most of the apparent edge in that style of model was look-ahead leakage — after purging it and charging realistic costs, single-stock direction landed at roughly a coin flip. Direction on one stock is dominated by market-wide moves nobody can predict.
So the question changed from "will this stock go up?" to "will it outperform the other 499?" — a cross-sectional ranking problem, where the market's move cancels between the legs and what's left is actually about the stock. That is the approach that survived.
This project stays up as the earlier rung. It is not the current recommendation, and the explainability layer — a grounded LLM that cites structured model output instead of inventing numbers — is the part of it that carried forward.