BACK2SERIES: Designing a Backtesting Framework for Time Series Forecasting into a RESTful API
Resumo
Research Context: Time series forecasting plays a crucial role in economics, finance, and other domains where accurately anticipating future outcomes is essential for informed decision-making. However, evaluating time series regression models requires specific methods to preserve temporal dependencies and ensure realistic assessments. Scientific and/or Practical Problem: Common validation approaches, such as random cross-validation, ignore time order, generating look-ahead bias and unreliable results. Existing libraries like skforecast and sktime provide partial solutions but lack comprehensive backtesting features, standardized procedures, and user-friendly interfaces for non-programmers. Proposed Solution and/or Analysis: This study introduces BACK2SERIES, a modular RESTful API for time series regression backtesting. It supports multiple scikit-learn estimators, expanding and rolling windows, periodic hyperparameter tuning, and proper data standardization to prevent information leakage. Its API architecture allows integration with Large Language Models (LLMs) for automated workflows. Related IS Theory: This work is grounded in Socio-technical Theory, as it integrates technical automation with human interaction, balancing system efficiency and user accessibility. It also draws on Process Virtualization Theory, enabling remote, automated, and reproducible workflows that make time series forecasting more accessible to both technical and non-technical users. Research Method: Following an exploratory case study methodology, the system was implemented in Python using FastAPI, Pandas, and scikit-learn. A case study was conducted forecasting the USD/BRL exchange rate using other emerging market currencies to validate the framework’s reproducibility and automation capabilities. Summary of Results: The API produced unbiased evaluations, automated hyperparameter tuning, and consistent model comparisons. Tests of LLM interaction confirmed that structured prompts enable complete, valid API calls. Contributions and Impact to IS Area: BACK2SERIES advances the Information Systems field by bridging rigorous time series evaluation with accessible deployment. It enables reproducible, automated, and explainable forecasting workflows, supporting both technical and non-technical users in data-driven decision-making.
Referências
Bergmeir, C., Hyndman, R. J., and Koo, B. (2018). A note on the validity of cross-validation for evaluating autoregressive time series prediction. Computational Statistics & Data Analysis, 120:70–83.
Berthold, Michael R., Cebron, Nicolas, Dill, Fabian, Gabriel, Thomas R., Kötter, Tobias, Meinl, Thorsten, Ohl, Peter, Sieb, Christoph, Thiel, Kilian, and Wiswedel, Bernd (2025). Knime – konstanz information miner. [link]. Accessed: 16 Jul 2025.
Demšar, Janez, Curk, Tomislav, Erjavec, Ales, Gorup, Črt, Hočevar, Tomaž, Milutinovič, Matija, Možina, Martin, Polajnar, Ana, Toplak, Marko, Starič, Andrej, Šikonja, Marko, and Zupan, Blaž (2025). Orange data mining - data mining fruitful and fun. [link]. Accessed: 16 Jul 2025.
European Central Bank (2019). Focus on the euro area economic outlook and cross-border financial resilience. [link]. Published: Mar 2019; Accessed: 16 Jul 2025.
Gupta, V. and Hewett, R. (2019). Adaptive normalization in streaming data. In Proceedings of the 3rd International Conference on Big Data Research, pages 12–17.
Hyndman, R. J. and Athanasopoulos, G. (2021). Forecasting: Principles and Practice. OTexts, Melbourne, Australia, 3rd edition.
James, G. M., Witten, D., Hastie, T., and Tibshirani, R. (2023). An Introduction to Statistical Learning: with Applications in R. Springer Texts in Statistics. Springer, New York, 3rd edition.
Kenton, W. and Kvilhaug, S. (2023). Backtesting: What it is, how it works, and example. [link]. Published: 6 May 2023; Accessed: 16 Jul 2025.
Löning, M., Bagnall, A., Ganesh, S., Kazakov, V., Lines, J., and Király, F. J. (2019). sktime: A unified interface for machine learning with time series. [link]. Accessed: 16 Jul 2025.
Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Thirion, B., Grisel, O., Blondel, M., Prettenhofer, P., Weiss, R., Dubourg, V., Vanderplas, J., Passos, A., Cournapeau, D., Brucher, M., Perrot, M., and Duchesnay, (2025). Scikit-learn user guide. [link]. Accessed: 16 Jul 2025.
Ramírez, S. (2025). Fastapi documentation. [link]. Accessed: 16 Jul 2025.
Song, Y., Xiong, W., Zhu, D., Wu, W., Qian, H., Song, M., Huang, H., Li, C., Wang, K., Yao, R., et al. (2023). Restgpt: Connecting large language models with real-world restful apis. arXiv preprint arXiv:2306.06624.
Zhan, H., Gomes, G., Li, X. S., Madduri, K., and Wu, K. (2018). Efficient online hyperparameter optimization for kernel ridge regression with applications to traffic time series prediction. arXiv preprint arXiv:1811.00620.
