Hierarchical Ensemble-Based Feature Selection for Time Series Forecasting

Aysin Tumay, Mustafa E. Aydin, Ali T. Koc, Suleyman S. KozatarXiv 2023 · DOI

Abstract

We introduce a novel ensemble approach for feature selection based on hierarchical stacking for non-stationarity and/or a limited number of samples with a large number of features. Our approach exploits the co-dependency between features using a hierarchical structure. Initially, a machine learning model is trained using a subset of features, and then the output of the model is updated using other algorithms in a hierarchical manner with the remaining features to minimize the target loss. This hierarchical structure allows for flexible depth and feature selection. By exploiting feature co-dependency hierarchically, our proposed approach overcomes the limitations of traditional feature selection methods and feature importance scores. The effectiveness of the approach is demonstrated on synthetic and well-known real-life datasets, providing significant scalable and stable performance improvements compared to the traditional methods and the state-of-the-art approaches. We also provide the source code of our approach to facilitate further research and replicability of our results.

Introduction

In time series forecasting, practitioners often encounter the "more is less" paradox. While access to hundreds of potential features—ranging from historical lags to exogenous variables like weather or market indices—is common, datasets are frequently small and non-stationary. This leads to the "curse of dimensionality," where models overfit to noise and fail to generalize to future data.

Traditional feature selection methods, such as filters (statistical tests), wrappers (iterative searching), and embedded methods (e.g., Lasso), often fall short because they ignore feature co-dependency, incur high computational costs, or struggle with non-differentiable loss functions like Mean Absolute Error (L1 loss). Furthermore, these methods often fail to account for non-stationarity, where the relationship between features and the target variable shifts over time.

Methodology

The core innovation of this research is a Hierarchical Ensemble-Based Method. Instead of a flat model architecture, the approach utilizes a multi-level structure to refine predictions successively.

The architecture of the proposed hierarchical ensemble method, showing how multiple base learners are combined using context-aware weights.

The Hierarchical Architecture

  1. Layer 1 (The Foundation): A base model (such as LightGBM) is trained on a "dominant" subset of features, typically historical lags of the target variable ($y_{t-j}$). While strong predictors, these are prone to overfitting.
  2. Cost Optimization: The algorithm performs a greedy search to find an optimal weight ($\alpha_t$) that scales the Layer 1 prediction to minimize a custom loss function. Crucially, this step does not require a Hessian, allowing for the direct optimization of robust metrics like L1 loss.
  3. Layer 2 (The Refinement): A second model is trained to predict these optimal weights ($\alpha_t$) using "side information" (exogenous features like date/time or external indices).
  4. Final Prediction: The refined prediction is the product (or weighted sum in the general $K$-layer case) of the base layer's output and the predicted weights, allowing the model to adjust the primary signal based on the current context.

Experimental Evaluation

The approach was evaluated on two primary benchmarks:

  • Synthetic Dataset: An ARMA(4, 5) process with 500 samples and 36 features designed to simulate non-stationarity, trends, and seasonality.
  • M4 Hourly Forecasting Dataset: A subset of 200 series from the M4 competition, featuring real-world business data with 33 features, including engineered date-related features.

Results and Discussion

The Hierarchical Ensemble consistently outperformed baseline LightGBM, standard ensembles, and wrapper methods across several dimensions:

  • Accuracy: On the synthetic dataset, the proposed method achieved significantly lower Mean Square Error (MSE) than the baseline LightGBM, which suffered from overfitting due to the high feature-to-sample ratio.
  • Efficiency: The speed gains over wrapper methods were substantial. On the synthetic dataset, the wrapper method took 393.8 seconds to converge, while the Hierarchical Ensemble required only 9.35 seconds.
  • Statistical Significance: Paired T-tests confirmed that the improvements were statistically significant, with p-values consistently below the 0.05 threshold.

Key Insights

  • Context-Aware Weighting: By using secondary features to adjust the primary model rather than just adding them to the feature pool, the hierarchy prevents the model from getting lost in high-dimensional space.
  • Bypassing GBM Limitations: The framework allows for L1 loss optimization in LightGBM, which is natively difficult due to the zero Hessian of the L1 norm.
  • Domain Expertise Integration: The hierarchy provides a natural way to prioritize trusted features in the first layer while using experimental features for marginal gains in subsequent layers.

Conclusion

This hierarchical stacking approach offers a scalable and stable solution for feature selection in complex time series tasks. While the current study focused on a 2-layer hierarchy using LightGBM, the framework is extensible to $K > 2$ layers and other base learners, such as Neural Networks. The source code for this implementation is available on GitHub to support further research.

Summary updated

BibTeX
@misc{tumay2023hierarchical,
  author = {Aysin Tumay and Mustafa E. Aydin and Ali T. Koc and Suleyman S. Kozat},
  title = {{Hierarchical Ensemble-Based Feature Selection for Time Series Forecasting}},
  year = {2023},
  eprint = {2310.17544},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2310.17544},
}
Figure