Per-Series Target Scaling
When one model forecasts thousands of series at wildly different sizes — a $5 penny stock and a $5,000,000-notional futures position — the raw targets need to be rescaled per series before training, or the model just learns to predict the biggest series and ignores the rest.
Prerequisites: Global vs Local Forecasting Models, Reframing Forecasting as Supervised Learning
Train a single global model to forecast trading volume for every stock in an index, and it will quickly learn one lazy trick: predict something close to whatever number minimizes average squared error across all series. Since a handful of mega-cap names trade in the tens of millions of shares while most small caps trade in the tens of thousands, that average gets dominated by the big names, and the model effectively ignores the small ones — not because it's a bad model, but because the loss function never told it their errors mattered.
The fix: scale each series to its own typical size
Per-series target scaling rescales each series' target (and often its numeric features) relative to that series' own history before the shared model ever sees it. A common approach divides each series' values by a summary statistic computed from its own recent history — its mean level, its recent standard deviation, or a robust measure like a recent median — so that after scaling, a "typical" value for every series sits in roughly the same numerical range, say around 1. The model then learns shape and pattern (does volume spike before earnings, does it decay after a rally) in this shared, comparable space, and predictions are rescaled back to the series' original units afterward using the same per-series statistic.
In plain English: instead of asking the model to learn "predict this stock's volume in shares," you ask it "predict this stock's volume as a multiple of its own recent typical volume" — a question that has a similar-looking answer whether the stock is a penny stock or a mega-cap, which is exactly what lets one shared model usefully pool information across very differently sized series.
Worked example: two stocks, one shared model
Stock A trades around 50,000 shares/day on a quiet day; Stock B trades around 5,000,000 shares/day. Suppose the scaling factor for each series is its trailing 30-day average volume: 50,000 for A, 5,000,000 for B. If tomorrow A trades 75,000 shares and B trades 6,000,000 shares, the scaled targets are for A and for B. Both scaled targets sit in a comparable "somewhat above typical" range, and a shared model trained on these ratios across thousands of stocks can learn a general pattern — like "volume runs about 1.5× typical the day after a large single-day price move" — that transfers across stocks of any size. Without scaling, the raw squared-error loss on B's 900,000-share miss would dwarf twenty small caps' errors combined, and the model would tune itself almost entirely to fit B-sized series.
Choosing the scale statistic
The scale is usually computed from data available before the forecast point, updated on a rolling basis so it tracks a series that is genuinely growing or shrinking over time (a stock that's had a 10-for-1 split, for instance). Common choices are a trailing mean, a trailing standard deviation, or — for series with occasional huge spikes — a more robust statistic like a trailing median, which won't itself be distorted by the one outlier day the model is trying to forecast.
Adjust the mean and standard deviation above — per-series scaling is doing something similar in spirit, shifting and rescaling each series' own distribution onto a shared, comparable footing before the model sees it.
What this means in practice
Per-series scaling is what makes global (one-model-for-many-series) forecasting practical at all; without it, pooling data across series of very different magnitude either underfits the small series or requires training many separate small models, losing the benefit of shared learning. The main design decision is choosing a scale statistic that's stable enough not to be itself distorted by the event you're forecasting, and updating it only from information available as of the forecast date.
Per-series target scaling divides each series' target by a statistic computed from that series' own history (its typical level or volatility) before feeding it to a shared model, putting differently sized series on a comparable footing so a global model doesn't just learn to fit the largest series.
A common mistake is computing the scale statistic using the full history, including data after the forecast date — for instance, using each stock's full-sample average volume rather than a trailing, point-in-time version. That leaks future information into the scaling factor and inflates backtest accuracy in a way that will not survive contact with live forecasting.
Related concepts
Practice in interviews
Further reading
- Salinas et al., DeepAR: Probabilistic Forecasting with Autoregressive Recurrent Networks
- Hyndman & Athanasopoulos, Forecasting: Principles and Practice, ch. 12