What a Stacking Meta-Learner Actually Does in a Stock-Forecasting Ensemble
2026-11-12 ยท hedgewing.ai Research
An ensemble of four neural networks produces four forecasts for the same stock on the same day. Something has to combine them. The simplest option is to average, and averaging already helps because the models make partly uncorrelated errors. Stacking goes one step further: it trains a second, small model, the meta-learner, whose only inputs are the base models' predictions and whose only job is to learn how to weight them.
Averaging versus learning the weights
A plain average assumes every model is equally reliable all the time. That is rarely true. A recurrent model may be strongest in steady trends, a convolutional model in choppy ranges, a Transformer when the relevant context is far back in the window. A meta-learner trained on historical predictions and outcomes can discover these patterns and assign weights that reflect them, and it can learn that two models which usually agree should count as less than two independent votes. The result is typically a modest but consistent improvement over the best single base model, which is the whole point: steadier forecasts, not spectacular ones.
The out-of-fold rule
The most important detail in stacking is one that is easy to get wrong. If the meta-learner is trained on predictions the base models made on their own training data, it learns to trust models that have simply memorised the past, and the ensemble looks brilliant in-sample and useless out of it. The fix is to generate the base-model predictions out-of-fold: each base model predicts periods it was not trained on, and only those predictions are used to fit the meta-learner. In a time-series setting this must respect chronology, so the folds are rolling windows rather than random shuffles. See /glossary/data-leakage and /glossary/cross-validation for the failure modes this prevents.
Keeping the meta-learner simple
The meta-learner should be the least expressive part of the system. With only four inputs and a noisy target, a flexible meta-learner will overfit to the quirks of a particular period and undo the diversification benefit the ensemble was built for. Regularised linear or logistic models, or very shallow trees, are the norm. If the meta-learner's weights swing wildly between retrains, that is a warning sign that it is fitting noise rather than learning a stable preference among the base models.
What the meta-learner cannot do
Stacking combines information; it does not create it. If all four base models are wrong in the same direction, because the market is reacting to news none of them can see, the meta-learner will be wrong too, and usually confidently so, since agreement among the models is exactly what it has learned to reward. That is why the vote split is reported alongside the combined forecast and why calibration is applied after stacking: the ensemble's output is turned into a probability that matches observed frequencies, which keeps unanimous-but-wrong cases from being presented as near-certainties.
How this appears on hedgewing.ai
hedgewing.ai's four base models (LSTM, GRU, TCN, and Transformer) are combined by a stacking meta-learner over the same set of engineered features, and Pro users see the per-model breakdown next to the ensemble forecast. The description at /glossary/stacking-ensemble and /glossary/ensemble-disagreement goes deeper. As always, model outputs are research inputs, not recommendations; backtests on the platform are in-sample and illustrative, and this article is not investment advice.