Project H
Engineering log

Ranking, not classification — framing the ML problem so it can be honest

Harish Subramanian
Harish Subramanian
·
Cover image for Ranking, not classification — framing the ML problem so it can be honest

The wrong question gets the wrong model

A lot of retail ML-for-trading projects start with the same instinct: train a binary classifier on "did this stock go up the next day?" Then they're surprised when the model outputs 0.51 for everything — basically flat, basically useless.

The problem usually isn't the data. It's the framing.

In a portfolio context — and every options book is a portfolio, even one position at a time — the question that matters is not "will this stock go up tomorrow?" It's "of the tradeable universe, which names are most likely to outperform their peers?" That's a ranking question, not a classification question, and the distinction changes everything downstream.

What ranking buys you

Three concrete advantages, all of them about honesty rather than cleverness:

1. It learns relative strength, not market direction

A binary classifier spends most of its capacity on the absolute up/down boundary — a boundary that moves every day with overall market direction, which the model cannot predict. Most of that effort is spent modelling noise.

A ranker doesn't care where the boundary sits. It cares which names are stronger than which, holding the day's direction constant. That relative, cross-sectional structure is where the signal actually lives.

2. It survives regime changes better

A classifier trained in a bull market learns "most things go up." Trained in a bear market, it learns the opposite. Neither generalises. A ranker learns statements of the form "names with these characteristics tend to outperform their peers" — which is a regime-invariant kind of statement, and regime-invariance is what lets a system stay standing when the macro tide turns.

3. Its outputs compose

A ranking score lives on a meaningful relative scale, so it can be blended with other independent signals — a news score, an event flag, a volatility regime — without weeks of calibration gymnastics. For a system whose entire philosophy is many weak signals, one view, that composability isn't a nicety. It's load-bearing.

Where the model stops and judgement starts

The model's job ends at ordering the universe. Everything after that — how conviction becomes a position, how positions are sized, when the system abstains, how risk overlays veto even a confident score — is deliberate human design, and it's where most of the engineering actually lives.

The specifics of that design — the features, the objectives, the parameters, the way signals are weighted together — stay private. Not because they're magic, but because publishing a recipe and forward-testing a hypothesis are different projects, and this one is the second.

What separates a good system from a great one

Having built and torn down a few iterations, three things stand out — none of them are the model:

  1. Honest validation. Out-of-sample testing that genuinely doesn't leak the future, corrected for how many ideas were tried before this one. It sounds trivial; it is the single most commonly-failed requirement in this genre. A backtest that survives that bar is still only a hypothesis — which is why the real test happens on the public paper scoreboard.

  2. Wide, independent inputs. More loosely-correlated signals beat deeper engineering on a few. The marginal input you almost didn't add is often the one that changes a decision on the day the regime turns.

  3. Discipline about dropping things. Most signals don't earn their keep. A continuous audit — does this input predict anything the others don't already capture? — is what keeps a system from accumulating decorative complexity that looks smart and does nothing.

The point

Framing the problem as ranking doesn't guarantee an edge. Nothing guarantees an edge — that's what makes markets interesting. What the framing buys is a model whose failures are legible: when it doesn't work, you can see where and why, and the forward test can say so in public. That's the standard everything in this project is held to.