3.1. Correlation of Observational and Reanalysis Data
Initially, aiming to assess the consistency between the observational and reanalysis datasets, a comparative analysis of hourly temperature and RH was performed for the study period (August 2022–October 2024). For this purpose, four criteria were selected: the mean values, standard deviations, median, and interquartile percentiles (25th and 75th), which were examined for both datasets (
Table 5). All differences (biases) were calculated as the difference between reanalysis data and observational data (ERA5-Land—Observations) (
Table 6).
The mean biases of the hourly temperature showed that the reanalysis data systematically underestimated (negative differences) the observed values, with a mean temperature of 16.6 °C for reanalysis data and 18.9 °C for observations, as a result presenting a mean difference of −2.3 °C and a median difference of −2.5 °C. This cold bias can be largely explained by the elevation and topographic differences between the meteorological station and the study area. Furthermore, the reanalysis data are based on a spatial grid (~9 km), which averages values over a relatively large scale and tends to smooth out local thermal conditions. Additionally, the standard deviation of reanalysis (7.0 °C) was lower than that of the observations (8.7 °C), with a mean difference of −1.7 °C. In general, when the reanalysis data underestimate the standard deviation, they also exhibit reduced variability compared to the observational data. This is also reflected in the 25th and 75th percentiles, which were lower for ERA5-Land (11.2 °C and 22.0 °C) compared to the observational dataset (12.3 °C and 25.1 °C). Finally, the corresponding differences (−1.1 °C and −3.1 °C) indicate a reduced representation of temperature extremes.
In the case of RH, the mean biases showed that the reanalysis data overestimated (positive differences) the observed values, simulating a more humid climate. The mean and median differences were +11.6% and +14.7%, respectively, indicating a consistent humid bias. This is consistent with the lower temperatures simulated by the reanalysis dataset, as well as with the influence of elevation and terrain representation, which can lead to higher moisture retention within the model grid cell. Furthermore, the variability (standard deviation) of RH was lower in the reanalysis data (15.2%) compared to the observations (20.1%), with a difference of −4.9%. This pattern is also evident in the RH percentiles, which are consistently higher in the reanalysis dataset than in the observations. The 25th percentile increases from 41.3% in the observations to 57.2% in ERA5-Land (+15.9%), and the 75th percentile rises from 74.2% to 82.1%. This indicates a systematic moist bias in the reanalysis data, with generally higher RH values across the distribution and a shift toward wetter conditions compared to observations.
Overall, the results suggest that reanalysis data (ERA5-Land) reproduce the general climatic conditions of the study area, despite systematic biases and reduced variability. Their use in combination with observational data is therefore considered appropriate, as they provide a more spatially representative description of the external climatic conditions in the study area.
3.3. Forecasting and Machine Learning Results
In this section, the results of the comparative evaluation of machine learning models for predicting indoor temperature and RH at the Archaeological Museum of Delphi are presented. To assess the reliability of the predictions, comparing different models and identifying differences in the behavior between temperature and RH, the analysis focused on the performance of the models for time horizons of 48 and 72 h. The evaluation was based on standard error and fit metrics (RMSE, MAE, and R2), allowing for a systematic comparison between the different methodological approaches.
Table 8 presents the best model for each variable (temperature and RH) and for each forecast time horizon (48 h and 72 h), based on the RMSE, MAE, and R
2 metrics. For temperature, the Gradient Boosting model shows the best performance in both time horizons. Specifically, for the 48 h horizon it achieves RMSE = 0.541, MAE = 0.415 and R
2 = 0.901, while for the 72 h horizon it achieves RMSE = 0.668, MAE = 0.524 and R
2 = 0.849. The high values of R
2 and the low errors indicate a very good fit between observed and predicted values, which shows that temperature is a variable whose behavior can be predicted quite well in the under study room of the museum.
Consistently, for RH, the Random Forest model emerges as the best compared to the others. Specifically, for the 48 h horizon it achieved RMSE = 6.536, MAE = 5.111 and R2 = −0.021, while for the 72 h horizon it achieved RMSE = 7.230, MAE = 5.759 and R2 = −0.248. The negative test-set R2 values indicate that the RH forecasts do not outperform a constant predictor defined by the mean of the test observations. However, because the test-set mean is not available at forecast issuance, additional comparisons were performed using operational baseline methods based only on information available at prediction time. At the 48 h horizon, the Random Forest model achieved an RMSE of 6.536, compared with 6.878 for the training-period mean and 7.557 for persistence, corresponding to RMSE reductions of approximately 5.0% and 13.5%, respectively. At the 72 h horizon, Random Forest achieved an RMSE of 7.230, outperforming persistence (RMSE = 8.437) by approximately 14.3%, although it did not surpass the training-period mean baseline (RMSE = 6.883). These results suggest that the RH models contain some horizon-dependent predictive information beyond persistence, but their performance remains insufficient to support reliable operational forecasting. Therefore, the RH forecasts should be interpreted primarily as a diagnostic benchmark that highlights current data limitations and provides a quantitative reference for future model improvements.
Table 9 presents the ranking of the models for each variable and forecasting horizon, allowing a more detailed comparison of their performance beyond the identification of the single best model. For temperature forecasting, Gradient Boosting consistently ranked first, achieving RMSE values of 0.541 and 0.668 and R
2 values of 0.901 and 0.849 for the 48 h and 72 h horizons, respectively. SVR followed closely, with only slightly lower predictive performance (e.g., RMSE = 0.605 and R
2 = 0.876 for the 48 h horizon), while Random Forest ranked third with comparatively higher errors and lower R
2 values. This consistent performance across models suggests that indoor temperature follows a relatively stable and predictable pattern, which can be effectively captured by different machine learning approaches.
For RH, the behavior is markedly different. Although Random Forest ranked first for both forecasting horizons, all evaluated models exhibited weak predictive performance, with negative R2 values and relatively high errors across both horizons. SVR and Gradient Boosting ranked second and third, respectively, with only marginal differences in performance. These results indicate that none of the tested models were able to reliably capture the dynamics of indoor relative humidity under the current feature configuration and forecasting setup.
Table 10 displays the most important predictors for each variable and forecasting horizon, based on permutation importance, quantified as the increase in RMSE when each feature is randomly permuted. For temperature, it is evident that the prediction is mainly based on the dynamics of the indoor environment itself. For the 48 h horizon, the most important variable is temp_in (0.0786), indicating that the current temperature is the strongest predictor. This effect is reinforced by lagged variables, such as temp_in_lag1 (0.0412) and temp_in_lag24 (0.0284), suggesting that temperature evolves continuously over time and does not change abruptly. A similar role is played by the smoothed variables (temp_in_roll24 = 0.0221, temp_in_roll6 = 0.0196), which capture the recent average state of the space. The same pattern is observed at the 72 h horizon, where temperature in (0.0524) remains the most important variable, although with a reduced influence. The variables temp_in_lag1 (0.0237) and temp_in_lag24 (0.0201) continue to contribute substantially, while the rolling variables show even less importance. This gradual decrease suggests that as the time horizon increases, the immediate memory of the system weakens, without losing the key role of the internal temperature. Overall, these results reflect the thermal inertia of the building, highlighting that current indoor temperature conditions strongly depend on their past values.
The behavior of RH is more complex and differs substantially from that of temperature. At the 48 h horizon, the most important variable is cos_day (0.0877), which indicates a strong seasonal component. At the same time, variables related to outdoor temperature, such as temp_era5_roll24 (0.0811) and temp_era5_lag6 (0.0383), also appear to be particularly influential. This suggests that RH is not determined solely by indoor conditions, but is significantly affected by external climatic forcing and its recent variations. At the 72 h horizon, this dependence becomes even more pronounced. The variable cos_day (0.0495) remains the dominant, followed by temp_era5_lag6 (0.0367) and day (0.0333), confirming that seasonality and the calendar signal play a decisive role. The outdoor temperature variables (temp_era5_lag1 = 0.0230, temp_era5_lag3 = 0.0165) continue to contribute, indicating that humidity is influenced by slower and broader environmental processes. These results provide clear interpretability evidence, showing that temperature forecasts are driven by indoor thermal persistence, while relative humidity is influenced by seasonal patterns and external climatic conditions.
Table 11 presents the most important factors influencing indoor temperature and RH predictions, as derived from the SHAP analysis. The mean absolute SHAP values capture the overall importance of each variable, while the mean SHAP values indicate the direction of their effect. For temperature, both at the 48 and 72 h forecasting horizons, it is evident that the predictions are based almost exclusively on the indoor conditions. The current indoor temperature (temp_in), along with its lagged values (temp_in_lag1, temp_in_lag24), are the dominant predictors. In addition, rolling averages (temp_in_roll6, temp_in_roll24) contribute significantly, capturing the short-term and medium-term evolution of the temperature. This behavior reflects the thermal inertia of the building, as the indoor temperature varies smoothly and strongly depends on its previous values. Even for the longest time horizon (72 h), the same structure remains, although the relative importance of the predictors decreases. This suggests that the “memory” of the system weakens over time, while still maintaining its dominant role.
Regarding RH, at the 48 h horizon, the most important predictors are primarily related to seasonality, including the day of the year (day), its harmonic component (sin_day), and the month (month). At the same time, indoor relative humidity (rh_in) also contributes to the prediction, although with lower importance compared to the seasonal variables. Of particular interest is the contribution of variables related to external conditions, such as the rolling average value of the outdoor temperature (temp_era5_roll24), which suggests that RH is significantly influenced by the recent evolution of the external climate. At the 72 h time horizon, the dependence on seasonality becomes even more pronounced. The variables doy, sin_day, and cos_day dominate, while the influence of outdoor temperature variables remains significant. The reduced contribution of direct indoor variables suggests that RH is not primarily governed by short-term internal “memory”, but rather by broader and slower processes associated with the external environment and seasonal cycles.
3.4. Indoor Conditions
To gain a holistic insight into the model’s performance in reproducing indoor temperature,
Figure 5 presents the observed and predicted time series for 48 h and 72 h forecasting horizons for an indicative month (October), rather than the full study period. Overall, the model reproduces the temperature temporal evolution satisfactorily, capturing both the general trend and daily fluctuations. In general, the predictions (red) tend to slightly underestimate the maxima and, in some cases, overestimate the minima. This suggests a mild smoothing effect (regression toward the mean), which is commonly observed in ensemble-based machine learning forecasting models. For both forecasting horizons, the largest deviations are mainly found during the first days of October, which may be related to increased variability of outdoor conditions and changes in the building’s thermal load. Around mid-October, a clear regime change is observed, with a drop in average temperature, where the model follows this transition reasonably well, albeit with a slight lag, demonstrating its ability to adapt to non-stationary conditions. More specifically, for the 48 h time horizon (
Figure 5a), very good agreement is observed between predicted and actual values. The model accurately reproduces both the amplitude and the phase of the daily cycles, with only minor deviations. Conversely, for the 72 h horizon (
Figure 5b), the performance shows a slight degradation, as expected due to the increased uncertainty associated with longer forecast horizons. Furthermore, the predicted daily temperature range is slightly reduced compared to the observed one, indicating a smoothing behavior. A small time lag in the appearance of peak values (of the order of a few hours) is also evident, which is typical in multi-step forecasting. Nevertheless, even at the 72 h horizon, the model preserves the 24 h periodicity remarkably well, suggesting that it successfully captures the underlying seasonal patterns. However, the model still reproduces the overall dynamics of the system satisfactorily.
Regarding RH, the model satisfactorily reproduces the general trend; however, it presents significant limitations in capturing short-term variability. More specifically, there is a pronounced smoothing in the forecasts, resulting in a significant underestimation of the range of variation of RH. The model tends to overestimate low values and, in some cases, underestimate high values, which indicates a tendency towards the mean value (regression to the mean). For the 48 h horizon (
Figure 6a), although the model follows the general trend, it struggles to capture abrupt changes, such as sharp peaks and troughs. At the same time, for the 72 h horizon (
Figure 6b), the performance deteriorates further, with greater smoothing and convergence of the predictions within a narrower range of values. Consequently, the sharp fluctuations and local minima observed in the measurements are not adequately reproduced, highlighting the model’s difficulty in reproducing high short-term variability and abrupt fluctuations. Nevertheless, despite the above limitations, the model retains the ability to reproduce the overall dynamics of relative humidity, which suggests that it has captured the basic patterns of the time series, but has difficulty reproducing the high variability.
Figure 7 displays scatter plots between observed and predicted values for indoor temperature and RH at 48 and 72 h forecasting horizons. These plots were constructed to visually assess the predictive performance of the models and to identify potential deviations between observed and predicted values. The proximity of the points to the 1:1 line reflects the agreement between predictions and observations, providing insight into the ability of the models to reproduce the indoor microclimate conditions. Specifically, for indoor temperature, the results indicate a strong agreement between observed and predicted values for both forecasting horizons. The majority of points are closely aligned along the 1:1 line, suggesting that the models effectively capture the underlying thermal dynamics of the space. A slight increase in dispersion is observed at the 72 h horizon, indicating a gradual reduction in predictive accuracy with increasing forecast time.
In contrast, the plots for relative humidity reveal a weaker relationship between observed and predicted values. The points are more widely scattered and deviate substantially from the 1:1 line, indicating limited model performance. This pattern suggests that the models tend to approximate average conditions rather than accurately capturing variability and extreme values of relative humidity. These findings highlight a clear contrast in predictive behavior, with temperature being reliably reproduced due to its temporal persistence. In contrast, RH shows weaker agreement, reflecting its more complex and externally driven dynamics.