Classification vs Regression Targets for Trading
Predicting whether a stock goes up and predicting how much it goes up are different problems with different failure modes. Which target to pick depends on how the forecast gets used, not on which model scores higher.
Prerequisites: Choosing What to Forecast
Two researchers can build a model on the same data, using the same features, and end up with completely different pipelines — one predicting a number, one predicting a label — because they never agreed on what the forecast was for. Getting this choice wrong does not show up as a crash. It shows up months later as a portfolio that trades the right direction at the wrong size, or a signal that looks great on one metric and useless on the one that pays the bills.
The problem, before any symbols
Say you want to forecast next week's return on a stock. There are two honest ways to state that as a machine-learning problem.
Regression: predict the number itself. The target is a continuous return, something like +1.8% or −0.4%. The model is graded on how close its number lands to the truth.
Classification: predict a bucket. The target is "up" or "down" — or "up more than 1%", "flat", "down more than 1%" if you want three buckets. The model is graded on how often it picks the right bucket.
These are not two views of the same forecast. They optimise for different things, they fail in different ways, and they push the rest of the research pipeline in different directions.
What each one actually buys you
A regression target keeps the magnitude information. If the true move was +5% and your model said +0.3%, that is a much bigger miss than the true move being +0.6% and your model saying +0.3% — and regression's loss function (typically squared or absolute error) reflects that. This matters a great deal if you size positions by the strength of the forecast: a model that only ever tells you "up" or "down" gives you no way to distinguish a high-conviction trade from a coin flip.
A classification target throws magnitude away on purpose. It asks a cruder question — right side or wrong side? — and in exchange it is far more robust to the outliers that plague financial returns. One earnings-day gap of +40% in your training set can drag a regression model's coefficients around badly, because squared error punishes big misses enormously; a classifier just sees one more "up" observation, no different in weight from a +0.5% day. If your trading rule genuinely only cares about direction — you take a fixed-size position either long or short — classification is asking the model the question you actually need answered, and not paying an accuracy cost to also get an answer to a question you don't need (the exact magnitude).
| Regression target | Classification target | |
|---|---|---|
| What's predicted | A continuous return | A direction or bucket |
| Sensitive to outliers | Yes, often badly | Much less |
| Preserves conviction/sizing information | Yes | Only if you keep predicted probabilities |
| Natural loss function | Squared or absolute error | Log-loss, cross-entropy |
| Matches a fixed-size directional bet | Poorly — over-engineered for the use case | Well |
| Matches a signal that scales position by strength | Well | Poorly, unless probabilities are used as a proxy |
The trap in the middle
The compromise that looks free — turn a classifier's predicted probability into a pseudo-magnitude, and use it for sizing — is not free. A probability of 0.62 that the stock goes up is not the same object as an expected return of +0.4%, even though people use them interchangeably. Probabilities are bounded, roughly comparable across stocks, and calibrated (if at all) to hit rate, not to the dollar payoff of being right. Treating "0.62" as if it were a return forecast smuggles a regression assumption back into a classification model that was never trained to make it.
Choose the target to match how the forecast is consumed downstream, not to match whichever framing gives the better backtest metric. A direction-only trading rule wants classification; a rule that sizes by conviction wants regression, or a classifier whose probabilities have been explicitly calibrated against realised magnitude.
The safest way to decide is to write out the trading rule first — in words, before any model exists — and ask what number it needs. If the rule is "go long or flat, same size every time," you need a label. If the rule is "scale the position with the strength of the signal," you need a number, and a classifier's probability is at best a stand-in for one, not a substitute.
When in doubt, fit both on the same split and compare the resulting portfolios, not the resulting accuracy scores. A regression model with a mediocre R² can still produce a better book than a classifier with 55% hit rate, because the two numbers answer different questions and neither translates cleanly into Sharpe ratio on its own.
Related concepts
Practice in interviews
Further reading
- Lopez de Prado, Advances in Financial Machine Learning (ch. 3, labeling)
- Chincarini & Kim, Quantitative Equity Portfolio Management