Evaluating Window Size Effects on Univariate Time Series Forecasting with Machine Learning

Authors

DOI:

https://doi.org/10.5753/jidm.2025.4668

Keywords:

Time Series, Machine Learning, Window Size, Ensembles, Neural Networks

Abstract

In the realm of time series prediction modeling, the window size (w) is a critical hyperparameter that determines the number of time units included in each example provided to a learning model. This hyperparameter is crucial because it allows the learning model to recognize both long-term and short-term trends, as well as seasonal patterns, while reducing sensitivity to random noise. This study aims to elucidate the impact of window size on the performance of machine learning algorithms in univariate time series forecasting tasks, specifically addressing the more challenging scenario of larger forecast horizons. To achieve this, we employed 40 time series from two different domains, conducting experiments with varying window sizes using four types of machine learning algorithms: Bagging (Random Forest), Boosting (AdaBoost), Stacking, and a Recurrent Neural Network (RNN) architecture, more specifically the Long Short-Term Memory (LSTM). The results reveal that increasing the window size generally enhances the evaluation metric values up to a stabilization point, beyond which further increases do not significantly improve predictive accuracy. This stabilization effect was observed in both domains when w values exceeded 100 time steps. Moreover, the study found that LSTM architectures do not consistently outperform ensemble models in various univariate time series forecasting scenarios.

Downloads

Download data is not yet available.

References

Abadi, M., Barham, P., Chen, J., Chen, Z., Davis, A., Dean, J., Devin, M., Ghemawat, S., Irving, G., Isard, M., et al. (2016). Tensorflow: A system for large-scale machine learning. In Proceedings of the 12th USENIX Symposium on Operating Systems Design and Implementation (OSDI 2016), pages 265–283, Savannah, GA, USA. USENIX Association. DOI: http://dx.doi.org/10.48550/arXiv.1605.08695.

Abolghasemi, M., Beh, E., Tarr, G., and Gerlach, R. (2020). Demand forecasting in supply chain: The impact of demand volatility in the presence of promotion. Computers & Industrial Engineering, 142:106380. DOI: http://dx.doi.org/10.1016/j.cie.2020.106380.

Araújo, J. L., Oliveira, E. A., Lima Neto, A. S., Andrade Jr, J. S., and Furtado, V. (2023). Unveiling the paths of covid-19 in a large city based on public transportation data. Scientific Reports, 13(1):5761. DOI: http://dx.doi.org/10.1038/s41598-023-32786-z.

Azlan, A., Yusof, Y., and Mohsin, M. F. M. (2019). Determining the impact of window length on time series forecasting using deep learning. International Journal of Advanced Computer Research, 9(44):260–267. DOI: http://dx.doi.org/10.19101/IJACR.PID77.

Bergström, C. and Hjelm, O. (2019). Impact of time steps on stock market prediction with lstm.

Bomfim, R., Pei, S., Shaman, J., Yamana, T., Makse, H. A., Andrade Jr, J. S., Lima Neto, A. S., and Furtado, V. (2020). Predicting dengue outbreaks at neighbourhood level using human mobility in urban areas. Journal of the Royal Society Interface, 17(171):20200691. DOI: http://dx.doi.org/10.1098/rsif.2020.0691.

Box, G. E. P. and Jenkins, G. M. (1976). Time Series Analysis: Forecasting and Control. Holden-Day, San Francisco.

Braga, D. J. F., da Silva, T. L. C., Rocha, A., Coutinho, G., Magalhães, R. P., Guerra, P. T., de Macêdo, J. A., and Barbosa, S. D. (2019). Time series forecasting to support irrigation management. Journal of Information and Data Management, 10(2):66–80. DOI: http://dx.doi.org/10.5753/jidm.2019.2037.

Breiman, L. (2001). Random forests. Machine learning, 45:5–32. DOI: http://dx.doi.org/10.1023/A:1010933404324.

Caminha, C., Furtado, V., Pequeno, T. H., Ponte, C., Melo, H. P., Oliveira, E. A., and Andrade Jr, J. S. (2017). Human mobility in large cities as a proxy for crime. PloS one, 12(2):e0171609. DOI: http://dx.doi.org/10.1371/journal.pone.0171609.

Caminha, C., Furtado, V., Pinheiro, V., and Ponte, C. (2018). Graph mining for the detection of overcrowding and waste of resources in public transport. Journal of Internet Services and Applications, 9(1):1–11. DOI: http://dx.doi.org/10.1186/s13174-018-0094-3.

Caminha, C., Furtado, V., Pinheiro, V., and Silva, C. (2016). Micro-interventions in urban transportation from pattern discovery on the flow of passengers and on the bus network. In 2016 IEEE International Smart Cities Conference (ISC2), pages 1–6. IEEE. DOI: http://dx.doi.org/10.1109/ISC2.2016.7580776.

Chandra, R., Goyal, S., and Gupta, R. (2021). Evaluation of deep learning models for multi-step ahead time series prediction. IEEE Access, 9:83105–83123. DOI: http://dx.doi.org/10.1109/ACCESS.2021.3085085.

Cheng, H., Tan, P.-N., Gao, J., and Scripps, J. (2006). Multistep-ahead time series prediction. In Advances in Knowledge Discovery and Data Mining: 10th Pacific-Asia Conference, PAKDD 2006, Singapore, April 9-12, 2006. Proceedings 10, pages 765–774. Springer. DOI: http://dx.doi.org/10.48550/arXiv.2103.14250.

Cover, T. and Hart, P. (1967). Nearest neighbor pattern classification. IEEE transactions on information theory, 13(1):21–27. DOI: http://dx.doi.org/10.1109/TIT.1967.1053964.

De Gooijer, J. G. and Hyndman, R. J. (2006). 25 years of time series forecasting. International journal of forecasting, 22(3):443–473. DOI: http://dx.doi.org/10.1016/j.ijforecast.2006.01.001.

Drucker, H., Burges, C. J., Kaufman, L., Smola, A., and Vapnik, V. (1996). Support vector regression machines. Advances in neural information processing systems, 9:155–161.

Frank, R. J., Davey, N., and Hunt, S. P. (2000). Input window size and neural network predictors. In Proceedings of the IEEE-INNS-ENNS International Joint Conference on Neural Networks. IJCNN 2000. Neural Computing: New Challenges and Perspectives for the New Millennium, volume 2, pages 237–242. IEEE. DOI: http://dx.doi.org/10.1109/IJCNN.2000.857903.

Freitas, J. D., Ponte, C., Bomfim, R., and Caminha, C. (2023). The impact of window size on univariate time series forecasting using machine learning. In Anais do XI Symposium on Knowledge Discovery, Mining and Learning, pages 65–72. SBC. DOI: http://dx.doi.org/10.5753/kdmile.2023.232916.

Freund, Y., Schapire, R. E., et al. (1996). Experiments with a new boosting algorithm. In icml, volume 96, pages 148–156. Citeseer.

Friedman, J. H. (2001). Greedy function approximation: a gradient boosting machine. Annals of statistics, 29(5):1189–1232. DOI: http://dx.doi.org/10.1214/aos/1013203451.

Galton, F. (1889). Natural inheritance, volume 42. Macmillan, London.

Hamzaçebi, C., Akay, D., and Kutay, F. (2009). Comparison of direct and iterative artificial neural network forecast approaches in multi-periodic time series forecasting. Expert systems with applications, 36(2):3839–3844. DOI: http://dx.doi.org/10.1016/j.eswa.2008.02.042.

Hochreiter, S. and Schmidhuber, J. (1997). Long short-term memory. Neural computation, 9(8):1735–1780. DOI: http://dx.doi.org/10.1162/neco.1997.9.8.1735.

Hoerl, A. E. and Kennard, R. W. (1970). Ridge regression: Biased estimation for nonorthogonal problems. Technometrics, 12(1):55–67. DOI: http://dx.doi.org/10.1080/00401706.1970.10488634.

Huber, J. and Stuckenschmidt, H. (2020). Daily retail demand forecasting using machine learning with emphasis on calendric special days. International Journal of Forecasting, 36(4):1420–1438. DOI: http://dx.doi.org/10.1016/j.ijforecast.2020.02.005.

Kil, R. M., Park, S. H., and Kim, S. (1997). Optimum window size for time series prediction. In Proceedings of the 19th Annual International Conference of the IEEE Engineering in Medicine and Biology Society.’Magnificent Milestones and Emerging Opportunities in Medical Engineering’(Cat. No. 97CH36136), volume 4, pages 1421–1424. IEEE. DOI: http://dx.doi.org/10.1109/IEMBS.1997.756971.

Kreinovich, V., Nguyen, H. T., and Ouncharoen, R. (2014). How to estimate forecasting quality: A system-motivated derivation of symmetric mean absolute percentage error (smape) and other similar characteristics. Departmental Technical Reports (CS).

Leites, J., Cerqueira, V., and Soares, C. (2024). Lag selection for univariate time series forecasting using deep learning: An empirical study. arXiv preprint arXiv:2405.11237. DOI: https://doi.org/10.48550/arXiv.2405.11237.

Liu, Y., Wang, Z., Yu, X., Chen, X., and Sun, M. (2022). Memory-based transformer with shorter window and longer horizon for multivariate time series forecasting. Pattern Recognition Letters, 160:26–33. DOI: http://dx.doi.org/10.1016/j.patrec.2022.05.010.

Makridakis, S. (1993). Accuracy measures: theoretical and practical concerns. International journal of forecasting, 9(4):527–529. DOI: http://dx.doi.org/10.1016/0169-2070(93)90079-3.

Nikolopoulos, K. and Fildes, R. (2013). Adjusting supply chain forecasts for short-term temperature estimates: a case study in a brewing company. IMA Journal of Management Mathematics, 24(1):79–88. DOI: http://dx.doi.org/10.1093/imaman/dps006.

Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Thirion, B., Grisel, O., Blondel, M., Prettenhofer, P., Weiss, R., Dubourg, V., et al. (2011). Scikit-learn: Machine learning in python. the Journal of machine Learning research, 12:2825–2830.

Ponte, C., Carmona, H. A., Oliveira, E. A., Caminha, C., Lima, A. S., Andrade Jr, J. S., and Furtado, V. (2021). Tracing contacts to evaluate the transmission of covid-19 from highly exposed individuals in public transportation. Scientific Reports, 11(1):24443. DOI: http://dx.doi.org/10.1038/s41598-021-03998-y.

Ponte, C., Melo, H. P. M., Caminha, C., Andrade Jr, J. S., and Furtado, V. (2018). Traveling heterogeneity in public transportation. EPJ Data Science, 7(1):1–10. DOI: http://dx.doi.org/10.1140/epjds/s13688-018-0172-6.

Salles, R., Belloze, K., Porto, F., Gonzalez, P. H., and Ogasawara, E. (2019). Nonstationary time series transformation methods: An experimental review. Knowledge-Based Systems, 164:274–291. DOI: http://dx.doi.org/10.1016/j.knosys.2018.10.041.

Shynkevich, Y., McGinnity, T. M., Coleman, S. A., Belatreche, A., and Li, Y. (2017). Forecasting price movements using technical indicators: Investigating the impact of varying input window length. Neurocomputing, 264:71–88. DOI: http://dx.doi.org/10.1016/j.neucom.2016.11.095.

Taieb, S. B., Bontempi, G., Atiya, A. F., and Sorjamaa, A. (2012). A review and comparison of strategies for multi-step ahead time series forecasting based on the nn5 forecasting competition. Expert systems with applications, 39(8):7067–7083. DOI: http://dx.doi.org/10.1016/j.eswa.2012.01.039.

Teixeira, J. P. and Fernandes, P. O. (2011). A insolação como parâmetro de entrada em modelo baseado em redes neuronais para previsão de série temporal do turismo. In VI Congresso Luso-Moçambicano de Engenharia.

Ughi, R., Lomurno, E., and Matteucci, M. (2023). Two steps forward and one behind: Rethinking time series forecasting with deep learning. arXiv preprint arXiv:2304.04553.

Wolpert, D. H. (1992). Stacked generalization. Neural networks, 5(2):241–259. DOI: http://dx.doi.org/10.1016/S0893-6080(05)80023-1.

Downloads

Published

2025-08-23

How to Cite

Freitas, J. D., Ponte, C., Bomfim, R., & Caminha, C. (2025). Evaluating Window Size Effects on Univariate Time Series Forecasting with Machine Learning. Journal of Information and Data Management, 16(1), 213–223. https://doi.org/10.5753/jidm.2025.4668

Issue

Section

Best Papers of KDMiLe 2023 - Extended Papers