# Optimizing Energy Forecasting Using ANN and RF Models for HVAC and Heating Predictions
## 3 Results and Discussions
### Actual and Predicted Energy Demand  
The findings are anticipated to support the optimization of HVAC system operations and energy management strategies. By leveraging predictions from the ANN and RF models, facility managers can forecast peak demand times for HVAC services and take proactive steps to ensure efficient resource utilization while reducing energy consumption. Furthermore, the data-driven methodology described can be continuously refined and adapted to changing environmental and operational conditions, ultimately improving the overall efficiency and robustness of the HVAC system. Figure 4a presents a comparative visualization of the actual energy demand (blue line) alongside predictions from two machine learning models: the Random Forest (RF) model (green line) and the Artificial Neural Network (ANN) model (red line). The plot provides a comprehensive comparison between measured HVAC demand and model forecasts. The analysis reveals that both models successfully captured the overall trend of cooling demand. However, the ANN model demonstrates superior performance in predicting both the timing and magnitude of peak demand periods, closely following the actual consumption curve. In contrast, the RF model shows greater deviation from actual values during high-demand periods, indicating reduced accuracy in forecasting peak HVAC loads. The ANN model demonstrates strong agreement with actual HVAC demand, especially during peak usage periods. For example, at sample index 1100, the ANN accurately predicts a demand spike of 270 kW, closely matching the observed peak of 290 kW. In contrast, while the RF model captures the overall demand trend, it systematically underestimates consumption during high-demand periods, predicting only 200 kW at the same sample point, significantly below the actual 290 kW requirement. For the FUHEM Building's heating demand analysis, shown in Figure 4b, we evaluated 100 randomly sampled data points across one year. The actual demand shows considerable temporal variability, posing a challenge for accurate prediction. Both models attempt to replicate this fluctuation, with their performance depending on how well they track the dynamic changes in the actual demand curve. The relationship between actual HVAC demand figures and the predicted values from the Random Forest (RF) and Artificial Neural Network (ANN) models is effectively illustrated in the scatter plot presented in Figure 5a. Such scatter plots are valuable in evaluating the accuracy and effectiveness of prediction models within HVAC systems. The plot indicates that the HVAC demand is dynamic and varied, with actual values (represented by blue dots) ranging from approximately \(-250\) kW to \(350\) kW. The red dots, depicting the ANN model's predictions cluster closely along the \(45\) degree line, indicating a strong alignment with actual values. In contrast, the green dots representing the RF model's predictions are more dispersed and deviate further from the \(45\) degree line. Despite this, the RF model still shows a positive correlation with actual values; however, the wide scatter suggests it struggles to capture the full complexity of HVAC demand. This performance gap between the ANN and RF models suggests that neural network approaches may offer advantages for accurately predicting HVAC system needs. Figure 4: Actual vs. predicted demand: (**a**) (LUCIA Building, nZEB -HVAC), (**b**) (FUHEM Building-Heating). Figure 5: Scatter plot: actual and predicted: (**a**) (LUCIA Building, nZEB-HVAC), (**b**) (FUHEM Building-Heating). Figure 5 compares actual heating demand values with forecasts from both models: Random Forest and Artificial Neural Network. The actual demand ranges from 0 to about 35 kWh. The ANN predictions, primarily shown in blue, closely align with actual values, particularly for lower demands. Conversely, the RF forecasts (in green) are less accurate, especially for larger demand figures, indicating that, while RF identifies certain trends, it may not fully capture peak demand.