Tesi etd-09102026-120645 |
Link copiato negli appunti
Tipo di tesi
Tesi di laurea magistrale
Autore
PARDOCCHI, LORENZO
URN
etd-09102026-120645
Titolo
Comparison of Grey-Box, XGBoost Black-Box and LLM Black-Box Models for Building Energy Forecasting
Dipartimento
INGEGNERIA DELL'ENERGIA, DEI SISTEMI, DEL TERRITORIO E DELLE COSTRUZIONI
Corso di studi
INGEGNERIA ENERGETICA
Relatori
.
relatore Prof. Baccioli, Andrea
Parole chiave
- energia
- energy
- forecasting
- previsione
Data inizio appello
29/09/2026
Consultabilità
Non consultabile
Data di rilascio
29/09/2096
Riassunto (Inglese)
This thesis focuses on the comparison of different modelling approaches applied to building energy forecasting, with particular reference to Grey Box models, XGBoost Black Box models, and LLM Black Box models. The main objective of the study is to evaluate the performance of these three approaches under different operating conditions by analysing their accuracy, stability, and forecasting capability, with the aim of identifying the most suitable model for the different scenarios considered.
The analysis was carried out by considering two different buildings, characterized by datasets of different nature. The first case study uses synthetic data generated through the Edilclima software, while the second is based on real data directly collected from an actual building. Both datasets were organised using an hourly timestep in order to ensure consistency among the simulations and to allow a direct and coherent comparison between the different models developed.
In the case of the real dataset, particular attention was devoted to the preliminary data cleaning and preprocessing stage. Data collected from monitoring systems may in fact contain anomalous values, measurement errors, missing data, or outliers which, if directly used during the training process, could compromise the reliability of the resulting forecasts. Therefore, a specific preprocessing and data-cleaning procedure was adopted in order to obtain a dataset that more accurately represents the actual energy behaviour of the building and to reduce the influence of possible anomalies.
The work then develops through a detailed analysis of the three modelling approaches. For each model, the main theoretical characteristics, the adopted structure, the input and output variables, and the logic used during the training and forecasting phases are described. In particular, the Grey Box model combines physical knowledge of the system with data-driven identification techniques; the XGBoost Black Box model is based on machine-learning algorithms using boosted decision trees, whereas the LLM Black Box model adopts an approach based on Large Language Models applied to energy forecasting.
For each of the three models, simulations were developed according to two different forecasting strategies: One Step Ahead (OSA) and recursive forecasting. The OSA approach predicts the evolution of the system one timestep at a time by using the information available from the previous step, whereas recursive forecasting progressively uses its own previous predictions as input for subsequent forecasting steps. This second approach therefore represents a more complex forecasting condition and is more strongly affected by error propagation over time.
Overall, the thesis includes a total of twelve different simulations: three OSA models applied to synthetic data, three OSA models applied to real data, three recursive models applied to synthetic data, and three recursive models applied to real data. This framework makes it possible to perform a structured comparison while keeping the simulation conditions, the variables used, and the analysed forecasting horizons as consistent as possible.
To quantitatively assess model performance, the main statistical indicators commonly adopted in forecasting applications were calculated, including the coefficient of determination R², the Root Mean Square Error (RMSE), and the Mean Absolute Error (MAE). These KPIs make it possible to evaluate both the overall ability of the models to reproduce the actual trend of the building energy demand and the magnitude of the errors generated during forecasting.
For the recursive models, a rolling validation procedure with a 10-hour forecasting horizon was also implemented. This methodology makes it possible to assess how model performance evolves as the forecasting horizon increases, thereby highlighting the possible accumulation of errors resulting from the iterative use of previous model predictions.
Finally, the concluding part of the thesis provides a critical comparison of the results obtained from the different models, highlighting their advantages, limitations, and potential fields of application. Based on the observed performance, possible future developments are also identified, with particular attention to the improvement of recursive forecasting strategies and to the potential offered by the use of Large Language Models in the field of building energy forecasting.
The analysis was carried out by considering two different buildings, characterized by datasets of different nature. The first case study uses synthetic data generated through the Edilclima software, while the second is based on real data directly collected from an actual building. Both datasets were organised using an hourly timestep in order to ensure consistency among the simulations and to allow a direct and coherent comparison between the different models developed.
In the case of the real dataset, particular attention was devoted to the preliminary data cleaning and preprocessing stage. Data collected from monitoring systems may in fact contain anomalous values, measurement errors, missing data, or outliers which, if directly used during the training process, could compromise the reliability of the resulting forecasts. Therefore, a specific preprocessing and data-cleaning procedure was adopted in order to obtain a dataset that more accurately represents the actual energy behaviour of the building and to reduce the influence of possible anomalies.
The work then develops through a detailed analysis of the three modelling approaches. For each model, the main theoretical characteristics, the adopted structure, the input and output variables, and the logic used during the training and forecasting phases are described. In particular, the Grey Box model combines physical knowledge of the system with data-driven identification techniques; the XGBoost Black Box model is based on machine-learning algorithms using boosted decision trees, whereas the LLM Black Box model adopts an approach based on Large Language Models applied to energy forecasting.
For each of the three models, simulations were developed according to two different forecasting strategies: One Step Ahead (OSA) and recursive forecasting. The OSA approach predicts the evolution of the system one timestep at a time by using the information available from the previous step, whereas recursive forecasting progressively uses its own previous predictions as input for subsequent forecasting steps. This second approach therefore represents a more complex forecasting condition and is more strongly affected by error propagation over time.
Overall, the thesis includes a total of twelve different simulations: three OSA models applied to synthetic data, three OSA models applied to real data, three recursive models applied to synthetic data, and three recursive models applied to real data. This framework makes it possible to perform a structured comparison while keeping the simulation conditions, the variables used, and the analysed forecasting horizons as consistent as possible.
To quantitatively assess model performance, the main statistical indicators commonly adopted in forecasting applications were calculated, including the coefficient of determination R², the Root Mean Square Error (RMSE), and the Mean Absolute Error (MAE). These KPIs make it possible to evaluate both the overall ability of the models to reproduce the actual trend of the building energy demand and the magnitude of the errors generated during forecasting.
For the recursive models, a rolling validation procedure with a 10-hour forecasting horizon was also implemented. This methodology makes it possible to assess how model performance evolves as the forecasting horizon increases, thereby highlighting the possible accumulation of errors resulting from the iterative use of previous model predictions.
Finally, the concluding part of the thesis provides a critical comparison of the results obtained from the different models, highlighting their advantages, limitations, and potential fields of application. Based on the observed performance, possible future developments are also identified, with particular attention to the improvement of recursive forecasting strategies and to the potential offered by the use of Large Language Models in the field of building energy forecasting.
Riassunto (Italiano)
La tesi tratta il confronto tra differenti approcci di modellazione applicati al forecasting energetico degli edifici, con particolare riferimento ai modelli Grey Box, XGBoost Black Box e LLM Black Box. L’obiettivo principale del lavoro è valutare le prestazioni dei tre approcci in differenti condizioni operative, analizzandone accuratezza, stabilità e capacità di previsione, al fine di individuare il modello più adatto alle diverse casistiche considerate.
L’analisi è stata condotta prendendo in esame due differenti strutture, caratterizzate da dataset di diversa natura. Il primo caso studio utilizza dati sintetici ottenuti mediante il software Edilclima, mentre il secondo si basa su dati reali acquisiti direttamente da un edificio reale. Entrambi i dataset sono stati organizzati adottando un timestep orario, in modo da garantire uniformità nelle simulazioni e consentire un confronto diretto e coerente tra i diversi modelli sviluppati.
Nel caso dei dati reali, particolare attenzione è stata dedicata alla fase preliminare di pulizia e trattamento del dataset. I dati provenienti da sistemi di monitoraggio possono infatti essere caratterizzati dalla presenza di valori anomali, errori di misura, dati mancanti o outlier che, se utilizzati direttamente durante il processo di addestramento, potrebbero compromettere l’affidabilità delle previsioni. È stata quindi adottata una procedura specifica di preprocessing e pulizia dei dati, con l’obiettivo di ottenere un dataset maggiormente rappresentativo del comportamento energetico reale dell’edificio e ridurre l’influenza di eventuali anomalie.
Il lavoro si sviluppa successivamente attraverso l’analisi dettagliata dei tre approcci modellistici. Per ciascun modello vengono descritte le principali caratteristiche teoriche, la struttura utilizzata, le variabili di ingresso e di uscita e le logiche adottate durante la fase di training e di previsione. In particolare, il modello Grey Box combina conoscenze fisiche del sistema con tecniche di identificazione basate sui dati; il modello XGBoost Black Box sfrutta invece algoritmi di machine learning basati su alberi decisionali potenziati, mentre il modello LLM Black Box utilizza un approccio basato sui Large Language Models applicati alla previsione energetica.
Per ciascuno dei tre modelli sono state sviluppate simulazioni secondo due differenti logiche di forecasting: One Step Ahead (OSA) e ricorsiva. La logica OSA prevede l’evoluzione del sistema avanzando di un singolo timestep alla volta e utilizzando le informazioni disponibili al passo precedente, mentre la previsione ricorsiva utilizza progressivamente le proprie predizioni precedenti come input per i passi temporali successivi. Questa seconda modalità consente di rappresentare una condizione di forecasting più complessa e maggiormente soggetta al fenomeno di propagazione dell’errore.
Complessivamente, la tesi comprende quindi dodici differenti simulazioni: tre modelli OSA applicati ai dati sintetici, tre modelli OSA applicati ai dati reali, tre modelli ricorsivi applicati ai dati sintetici e tre modelli ricorsivi applicati ai dati reali. Tale impostazione permette di effettuare un confronto strutturato, mantenendo il più possibile omogenee le condizioni di simulazione, le variabili utilizzate e gli orizzonti temporali analizzati.
Per valutare quantitativamente le prestazioni dei modelli sono stati calcolati i principali indicatori statistici utilizzati nell’ambito del forecasting, tra cui il coefficiente di determinazione R², il Root Mean Square Error (RMSE) e il Mean Absolute Error (MAE). Tali KPI consentono di analizzare sia la capacità generale del modello di seguire l’andamento reale del fabbisogno energetico sia l’entità degli errori commessi durante la previsione.
Per i modelli ricorsivi è stata inoltre implementata una rolling validation con orizzonte di previsione pari a 10 ore. Questa metodologia permette di valutare l’evoluzione delle prestazioni al progressivo aumento dell’orizzonte di forecasting, evidenziando l’eventuale accumulo dell’errore derivante dall’utilizzo iterativo delle predizioni precedenti.
La parte conclusiva della tesi propone infine un confronto critico tra i risultati ottenuti dai diversi modelli, mettendone in evidenza vantaggi, limiti e possibili campi di applicazione. Sulla base delle prestazioni osservate vengono inoltre individuati possibili sviluppi futuri, con particolare attenzione al miglioramento delle strategie di forecasting ricorsivo e alle potenzialità offerte dall’impiego dei Large Language Models nel settore della previsione energetica degli edifici.
L’analisi è stata condotta prendendo in esame due differenti strutture, caratterizzate da dataset di diversa natura. Il primo caso studio utilizza dati sintetici ottenuti mediante il software Edilclima, mentre il secondo si basa su dati reali acquisiti direttamente da un edificio reale. Entrambi i dataset sono stati organizzati adottando un timestep orario, in modo da garantire uniformità nelle simulazioni e consentire un confronto diretto e coerente tra i diversi modelli sviluppati.
Nel caso dei dati reali, particolare attenzione è stata dedicata alla fase preliminare di pulizia e trattamento del dataset. I dati provenienti da sistemi di monitoraggio possono infatti essere caratterizzati dalla presenza di valori anomali, errori di misura, dati mancanti o outlier che, se utilizzati direttamente durante il processo di addestramento, potrebbero compromettere l’affidabilità delle previsioni. È stata quindi adottata una procedura specifica di preprocessing e pulizia dei dati, con l’obiettivo di ottenere un dataset maggiormente rappresentativo del comportamento energetico reale dell’edificio e ridurre l’influenza di eventuali anomalie.
Il lavoro si sviluppa successivamente attraverso l’analisi dettagliata dei tre approcci modellistici. Per ciascun modello vengono descritte le principali caratteristiche teoriche, la struttura utilizzata, le variabili di ingresso e di uscita e le logiche adottate durante la fase di training e di previsione. In particolare, il modello Grey Box combina conoscenze fisiche del sistema con tecniche di identificazione basate sui dati; il modello XGBoost Black Box sfrutta invece algoritmi di machine learning basati su alberi decisionali potenziati, mentre il modello LLM Black Box utilizza un approccio basato sui Large Language Models applicati alla previsione energetica.
Per ciascuno dei tre modelli sono state sviluppate simulazioni secondo due differenti logiche di forecasting: One Step Ahead (OSA) e ricorsiva. La logica OSA prevede l’evoluzione del sistema avanzando di un singolo timestep alla volta e utilizzando le informazioni disponibili al passo precedente, mentre la previsione ricorsiva utilizza progressivamente le proprie predizioni precedenti come input per i passi temporali successivi. Questa seconda modalità consente di rappresentare una condizione di forecasting più complessa e maggiormente soggetta al fenomeno di propagazione dell’errore.
Complessivamente, la tesi comprende quindi dodici differenti simulazioni: tre modelli OSA applicati ai dati sintetici, tre modelli OSA applicati ai dati reali, tre modelli ricorsivi applicati ai dati sintetici e tre modelli ricorsivi applicati ai dati reali. Tale impostazione permette di effettuare un confronto strutturato, mantenendo il più possibile omogenee le condizioni di simulazione, le variabili utilizzate e gli orizzonti temporali analizzati.
Per valutare quantitativamente le prestazioni dei modelli sono stati calcolati i principali indicatori statistici utilizzati nell’ambito del forecasting, tra cui il coefficiente di determinazione R², il Root Mean Square Error (RMSE) e il Mean Absolute Error (MAE). Tali KPI consentono di analizzare sia la capacità generale del modello di seguire l’andamento reale del fabbisogno energetico sia l’entità degli errori commessi durante la previsione.
Per i modelli ricorsivi è stata inoltre implementata una rolling validation con orizzonte di previsione pari a 10 ore. Questa metodologia permette di valutare l’evoluzione delle prestazioni al progressivo aumento dell’orizzonte di forecasting, evidenziando l’eventuale accumulo dell’errore derivante dall’utilizzo iterativo delle predizioni precedenti.
La parte conclusiva della tesi propone infine un confronto critico tra i risultati ottenuti dai diversi modelli, mettendone in evidenza vantaggi, limiti e possibili campi di applicazione. Sulla base delle prestazioni osservate vengono inoltre individuati possibili sviluppi futuri, con particolare attenzione al miglioramento delle strategie di forecasting ricorsivo e alle potenzialità offerte dall’impiego dei Large Language Models nel settore della previsione energetica degli edifici.
File
| Nome file | Dimensione |
|---|---|
Tesi non consultabile. |
|