Temporal Encoding Strategies for Energy Time Series Prediction
Aayam Bansal, Keertan Balaji, Zeus Lalani
TL;DR
This work tackles energy consumption forecasting in smart grids by introducing sinusoidal encoding of cyclic temporal features to better capture periodic patterns. The authors implement a modular pipeline using ensemble models (XGBoost and LightGBM) with Bayesian-optimized hyperparameters and k-fold time-series cross-validation, combining sinusoidal temporal encoding with rolling statistics. They demonstrate that sinusoidal encoding yields substantial gains, for example reducing RMSE from $0.5497$ to $0.4802$ and increasing $R^2$ from $0.7530$ to $0.8118$, with LightGBM achieving the best overall performance ($RMSE=0.3983$, $R^2=0.8356$) and only modest computational overhead. The results are supported by ablation studies, feature-importance analysis, and assessments of robustness and generalization, indicating practical viability for real-time energy forecasting in diverse temporal contexts. The work advances temporal feature engineering by providing a scalable, interpretable, and efficient approach to capturing cyclic patterns in time series data.
Abstract
In contemporary power systems, energy consumption prediction plays a crucial role in maintaining grid stability and resource allocation enabling power companies to minimize energy waste and avoid overloading the grid. While there are several research works on energy optimization, they often fail to address the complexities of real-time fluctuations and the cyclic pattern of energy consumption. This work proposes a novel approach to enhance the accuracy of predictive models by employing sinusoidal encoding on periodic features of time-series data. To demonstrate the increase in performance, several statistical and ensemble machine learning models were trained on an energy demand dataset, using the proposed sinusoidal encoding. The performance of these models was then benchmarked against identical models trained on traditional encoding methods. The results demonstrated a 12.6% improvement of Root Mean Squared Error (from 0.5497 to 0.4802) and a 7.8% increase in the R^2 score (from 0.7530 to 0.8118), indicating that the proposed encoding better captures the cyclic nature of temporal patterns than traditional methods. The proposed methodology significantly improves prediction accuracy while maintaining computational efficiency, making it suitable for real-time applications in smart grid systems.
