Time-series Forecasting of Electricity Prices for Industries in Portugal: A Real-world Internship-based Study

Date

2025-11-25

Embargo

Coadvisor

Journal Title

Journal ISSN

Volume Title

Publisher

Language
English

Research Projects

Organizational Units

Journal Issue

Alternative Title

Abstract

This work presents the development of a short-term electricity price forecasting solution using machine learning, conducted during the author’s internship at Vanaci Prime, an IT consulting firm specializing in data-driven solutions. The project was developed for the Portuguese market, in collaboration with a client from the energy sector, and addresses the critical need for accurate, real-time, and scalable electricity price forecasts to support strategic planning, cost optimization, and operational decision-making. The forecasting system is built upon a unified dataset combining information from three authoritative sources: OMIE (day-ahead marginal electricity prices for the Iberian market), REN Datahub (electricity load and renewable generation), and the Copernicus Climate Data Store (meteorological variables including temperature, solar radiation, and precipitation). The combined data underwent extensive time-series preprocessing and feature engineering, including lag features, rolling statistics, calendar-based encodings, interaction terms, and normalized indicators reflecting load trends and solar activity. Multiple machine learning models were explored—namely LightGBM, XGBoost, and Extra Trees—with LightGBM ultimately selected due to its superior performance and generalization capability. A complete machine learning pipeline in Python was developed to automate the transformation of raw input data into model-ready features. To enhance the solution’s practical utility, a consumerfocused component was added to estimate potential monthly savings based on predicted electricity prices. The trained model and preprocessing pipeline are serialized and deployed using the FastAPI web framework to serve real-time predictions via web endpoints. Overall, the work demonstrates how artificial intelligence techniques can be used to automate and optimize electricity price forecasting by integrating environmental, market, and load data, while offering a replicable methodology for similar forecasting challenges in the energy sector.

Keywords

Electricity price forecasting, Machine learning, Time series

Document Type

Master thesis

Publisher Version

Dataset

Citation

Khalid, N. (2025). Time-series Forecasting of Electricity Prices for Industries in Portugal: A Real-world Internship-based Study [Dissertação de Mestrado em Ciência de Dados, Universidade Portucalense]. Repositório Institucional UPT. https://hdl.handle.net/11328/6851

TID

Designation

Mestrado em Ciência de Dados
Access Type

Open Access

Sponsorship

Description