# Optimizing Energy Forecasting Using ANN and RF Models for HVAC and Heating Predictions
## 1 Introduction
### Literature Review  
[PERSON] et al. [20] investigated the energy requirements of buildings, focusing on factors such as weather, structure, lighting, and HVAC systems. Their study analyzed data from a building in Eboli, Italy, collected between 2011 and 2013, employing an Artificial Neural Network (ANN) with six neurons and one hidden layer trained using the Levenberg-Marquardt method. They presented regression charts that compared expected energy output (NAR output) with actual energy demand (NAR target). The accuracy of energy consumption estimates, as measured by Root Mean Square Percentage Error (RMSPE), ranged from 15.7% to 17.97%, with slight variations based on prediction horizons of three, six, and twelve months. In contrast, [PERSON] et al. [21] utilized an ANN to explore energy savings in buildings, achieving accuracy within \(\pm\)10% for overall consumption and heating/cooling variances. Their MSHD approach yielded a lighting consumption accuracy of \(\pm\)10% and heating/cooling accuracy of \(\pm\)2%, ensuring overall energy variance remained below 10%. [PERSON] et al. [22] studied how insulation thickness and orientation affect building energy needs using finite difference numerical methods. They examined three building samples with insulation thicknesses from 0 to 15 cm and orientation angles from 0 to 80 degrees utilizing an ANN toolbox in MATLAB (Version R2018a, MathWorks) and FORTRAN 77 software. Their findings indicated an impressive prediction accuracy of 94.8% to 98.5%, with a variance of 3.43%. [PERSON] et al. [23] employed predictive techniques, including regression and ANN, to estimate hourly energy consumption for four buildings in the United States. These results aim to enhance energy conservation efforts in existing structures and improve energy efficiency in construction design. [PERSON] et al. [24], through the International Energy Agency, developed an innovative approach combining artificial intelligence and neural networks to predict indoor environments in near-zero-energybuildings (nZEB). This strategy aims to further research indoor conditions and building construction while enhancing our understanding of permeable material behavior. [PERSON] et al. (2020) explored nonlinear auto-regression Artificial Neural Networks for accurate predictions of building energy consumption, optimizing models with genetic algorithms and evaluating performance using statistical metrics ([PERSON] et al., 2019; [PERSON] et al., 2020). [PERSON] et al. (2020) introduced an intelligent optimization framework integrating AI models to achieve near-zero-energy-consumption buildings (nZEB). This framework demonstrated effective multi-objective optimization and high prediction accuracy, resulting in 21.25% energy savings for a teaching building in Wuhan. They recommended using Random Forest algorithms within a Big Data framework to accurately forecast household energy demand, leveraging socioeconomic data and advanced scaling techniques to enhance energy management efficiency. Additionally, a Random Forest (RF) ensemble approach was proposed for predicting hourly energy consumption in two educational buildings in North Central Florida (2020). [PERSON] et al. (2020) found that RF was less sensitive to variable parameters and outperformed regression tree (RT) and support vector regression (SVR) in prediction accuracy, showing improvements of 14-25% and 5-5.5%, respectively. They also noted that the most significant factors for energy prediction varied by semester, emphasizing the importance of accounting for shifts in energy behavior throughout the academic year ([PERSON] et al., 2019; [PERSON] et al., 2020; [PERSON] et al., 2020). Table 1 summarizes the literature review with mathematical models, proposed for this paper, time period, and accuracy. Although numerous studies have employed artificial intelligence techniques such as Artificial Neural Networks (ANN) and Random Forest (RF) models to predict building energy consumption and optimize energy management, there remains a significant research gap.