## 5 Conclusions  
This study proposes the development of a model named nUBEM, national-scale urban building energy model, which, based on the physical and geospatial characteristics of buildings, is capable of predicting NRPEC and the GHG emissions through artificial intelligence. For this, the XGBoost algorithm was trained with a dataset containing all residential buildings in Spain that have an open EPC and open data on their physical and geospatial characteristics.  
The generated model uses open data from the cadastre, cadastre INSPIRE, digital terrain models (DTMs), and national statistics. To train the model, it employs the NRPEC and the GHG emissions from the EPCs as target variables. All this information is provided by open government sources and under the common frameworks of various European directives, making it potentially applicable to all EU member states that have implemented these common frameworks.  
It is observed that gradient boosted trees, and in particular, the XGBoost algorithm, is the best-performing algorithm for this type of data and purpose, achieving better results in NMBE and RMSE and R\({}^{2}\) compared to the other techniques analyzed. This aligns with other similar analyses that also find Gradient Boosted Trees to be the most effective predicting building energy performance [43].  
The nUBEM was shown to accurately predict the primary non-renewable energy consumption of buildings on a national scale. As of 1 January 2024, only 13.8% of residential buildings in Spain have an EPC. This model allows for the assessment of energy performance across all existing buildings nationwide, encompassing a total of 1,246,864 structures.  
By identifying the least efficient buildings, the model aids in developing targeted renovation strategies focused on the 43% of residential buildings that perform the worst, in accordance with the requirements of the 2024 recast of the EPBD. The nUBEM demonstrated its effectiveness as a tool for generating progress indicators that facilitate the analysis of the residential building stock and its energy behavior, ultimately promoting data-driven policies and effective building renovation plans.  
Furthermore, the results obtained have proven to be accurate compared to existing scientific literature, achieving national-scale outcomes that surpass those of previous studies.  
Conceptualization, C.B.-V., M.M.-C. and B.L.-M.; methodology, C.B.-V., M.M.-C. and B.L.-M.; software, C.B.-V.; validation, C.B.-V., M.M.-C. and B.L.-M.; formal analysis, C.B.-V.; investigation, C.B.-V.; resources, C.B.-V., M.M.-C. and B.L.-M.; data curation, C.B.-V.; writing--original draft preparation, C.B.-V. and M.M.-C.; writing--review and editing, M.M.-C. and B.L.-M.; visualization, C.B.-V.; supervision, M.M.-C. and B.L.-M.; project administration, B.L.-M.; funding acquisition, B.L.-M. All authors have read and agreed to the published version of the manuscript.  
This research was funded by Ministry of Science and Innovation, Spain, grant number PID2019-104871 RB-C21/AEI/10.13039/501100011033 and by Gobierno de Aragon, Spain, grant number T37_23R: Built4 Life Lab.  
Not applicable.  
**Data Availability Statement:** The code developed to generate the nUBEM is available on Zenodo at [[https://doi.org/10.5281/zenodo.14524563](https://doi.org/10.5281/zenodo.14524563)]([https://doi.org/10.5281/zenodo.14524563](https://doi.org/10.5281/zenodo.14524563)).  
**Conflicts of Interest:** The authors declare no conflicts of interest.