Courtyard design for energy efficiency and thermal comfort: machine learning insights across hot and warm climates

Machine Learning


Global dataset overview

The simulation database revealed a wide spectrum of performance outcomes, with annual energy use intensity ranging between 56.4 and 142.1 kWh/m2 year and thermal discomfort hours between 40.6 and 1344.4. Mean values across the full set were 88.8 kWh/m2 year for energy and 517 h for discomfort, reflecting the breadth of variation generated by the factorial combinations of geometry, envelope, and climate, check Fig. 9. These results indicate that courtyard configuration can substantially alter residential performance, yet they also highlight a recurrent misalignment between the two objectives: configurations that minimized energy demand often produced elevated discomfort, whereas those that suppressed discomfort hours were generally associated with moderate or high energy consumption.

Fig. 9
figure 9

EUI and discomfort over different cities.

The box plot of discomfort hours reveals a clear hierarchy across climates (Fig. 10). Cairo performs most favorably, with the lowest median and interquartile range, indicating relatively consistent comfort performance under hot-dry conditions. Gizan follows with moderate medians and a narrower spread, suggesting that despite its humid climate, discomfort values are less variable across design options. Miami exhibits higher discomfort levels, with a median above 550 h and a wide distribution that extends to nearly 1000 h, underscoring the difficulty of achieving comfort in very hot-humid conditions. Riyadh shows considerable variability, spanning some of the lowest values across all cities but also a long upper tail, reflecting strong design sensitivity in very hot-dry climates. Sevilla records the highest discomfort overall, with both the median and interquartile range shifted upward, confirming that even in a warm-Mediterranean context, many configurations are unable to suppress overheating effectively.

Fig. 10
figure 10

Discomfort box analysis over cities.

The box plot of energy use intensity shows a different ordering (Fig. 11). Gizan emerges as the most efficient city, with the lowest median EUI (≈ 70 kWh/m2 year) and the tightest interquartile spread. Cairo and Sevilla occupy intermediate positions, both clustering around 80–90 kWh/m2 year, though Sevilla shows a broader distribution. Miami is less efficient, with medians approaching 100 kWh/m2 year, and Riyadh records the highest energy intensities, exceeding 100 kWh/m2 year in the median and extending above 140 kWh/m2 year, reflecting the heavy cooling burden in its very hot-dry context.

Fig. 11
figure 11

EUI box analysis over cities.

Taken together, the global dataset demonstrates that no single parameter dictates performance. Instead, outcomes emerge from coupled effects among geometry, envelope, and climate, underscoring the necessity of data-driven modeling. The divergence between energy- and comfort-optimal tendencies observed at the global scale provides a rationale for the subsequent per-city analyses, where context-specific prescriptions are extracted and contrasted.

Per-city optima

The factorial dataset allows identification of climate-specific optima for both energy efficiency and thermal comfort (Fig. 12). Tables 4 and 5 summarize the three best-performing configurations per city for each objective, providing a more robust picture than single minima. Each configuration is defined by court geometry (width, length), envelope specification (construction, glazing, WWR), and orientation, with the secondary performance metric reported for context.

Fig. 12
figure 12

Top-3 energy- and comfort-optimal configurations per city.

Table 4 Top 3 energy-optimal configurations per city.
Table 5 Top 3 discomfort-optimal configurations per city.

Across all climates, the lowest energy use intensities (EUI) consistently occurred in compact courtyard forms with small plan dimensions (6–9 m width, 9–10 m length), low window-to-wall ratios (20%), and external insulation. Glazing type also emerged as decisive, with double glazing (air- or argon-filled) dominating the top-ranked cases.

  • Hot-humid climates (Gizan, Miami): North-facing orientations yielded the lowest EUI, reflecting the need to minimize direct solar exposure in humid regimes. However, these configurations produced relatively high annual discomfort hours (≈ 500–980 h), indicating a trade-off.

  • Hot-dry climates (Cairo, Riyadh): South-facing compact courts were consistently energy-optimal. In Cairo, the best case achieved 71.4 kWh/m2 year with discomfort ≈127 h, while in Riyadh the minimum was 81.4 kWh/m2 year but with discomfort > 260 h, underscoring a divergence between energy and comfort.

  • Warm-Mediterranean climate (Sevilla): Optima favored slightly larger plans (6 × 10 m) with external insulation and argon glazing, oriented south. While the lowest EUI was 71.9 kWh/m2 year, discomfort exceeded 600 h, reflecting the less severe but still significant comfort penalties when optimizing for energy alone.

Overall, energy minima cluster tightly around compact, shaded, externally insulated geometries, but consistently at the expense of higher discomfort.

The lowest discomfort hours were achieved under contrasting conditions: elongated courtyards (length 12 m), higher WWR (40–80%), and double argon glazing. Unlike the energy optima, comfort minima sometimes favored internal insulation and orientations that maximized controlled solar and ventilation gains.

  • Cairo: Achieved the absolute lowest discomfort of the dataset (40.6 h) with a 6 × 12 m court, 40% WWR, argon glazing, and south orientation. Notably, this configuration also performed relatively well in energy terms (77.2 kWh/m2 year), indicating partial alignment of the two objectives in hot-dry contexts.

  • Riyadh: Discomfort minima also occurred at 6 × 12 m with 40% WWR and argon glazing, but required internal insulation, reducing discomfort to 67 h while energy rose to ≈ 90 kWh/m2 year.

  • Gizan and Miami: Larger WWR values (60–80%) and elongated courtyards drove discomfort reductions, but often at the cost of substantially higher EUI (> 90 kWh/m2 year). For instance, Gizan’s best comfort case (196 h) required 80% WWR and east orientation, doubling discomfort benefits relative to the energy optimum but raising energy demand.

  • Sevilla: Comfort minima favored internal insulation with elongated courts and high WWR (80%), achieving 263 h discomfort and ≈ 80 kWh/m2 year energy.

In summary, comfort optimization systematically diverged from energy optima, preferring longer courts and higher glazing ratios, with insulation placement (internal vs. external) becoming climate-dependent. However, Energy- and comfort-optimal cases overlap more closely, especially in Cairo where the comfort optimum is also relatively energy efficient. Divergence in humid climates (Miami, Gizan): Comfort reduction requires strategies that sharply increase energy demand, underscoring the difficulty of achieving simultaneous optima in these regions. Intermediate behavior in Sevilla: Comfort and energy optima partly align in absolute performance, though their design prescriptions differ (internal insulation vs. external). These contrasts reinforce the necessity of climate-specific guidance: whereas hot-dry contexts allow for relatively integrated prescriptions, humid climates pose intrinsic trade-offs between efficiency and comfort, requiring prioritization based on policy or occupant needs.

ML model performance

To evaluate the predictive capacity of machine learning for this dataset, Random Forest Regression models were trained independently for each city and for each objective (energy use intensity and discomfort hours). An 80/20 train–test split was applied, with models trained on the design parameters (geometry, WWR, glazing, insulation, and orientation) and validated against the simulation outputs. Predictive skill was assessed using the coefficient of determination (R2), mean absolute error (MAE), and root mean square error (RMSE).

The results confirm that Random Forest achieved very high accuracy across all climates and objectives (Table 6). For energy use intensity, R2 values consistently exceeded 0.99, with MAE below 0.7 kWh/m2 year and RMSE under 1.0. Discomfort-hour predictions were slightly less accurate but still robust, with R2 values between 0.991 and 0.995 and error magnitudes (MAE ≈ 5–13 h, RMSE ≈ 7–18 h) that are negligible relative to the full dataset range of 40–1344 h. Among the cities, Gizan and Cairo showed the tightest fits, reflecting their narrower distributions, while Riyadh and Sevilla exhibited marginally higher errors due to broader variability in outcomes. Miami achieved strong predictive performance despite its wider comfort distribution, indicating that the Random Forest framework successfully captured the nonlinear interactions of design and climate.

Table 6 Random Forest model performance per city and objective.

Overall, the predictive performance of the models provides a reliable basis for the interpretability analysis in “Variable importance and SHAP plots”. The consistently high R2 values and low error magnitudes indicate that Random Forest successfully learned the complex relationships among geometry, envelope, and climate, ensuring that the feature importance and SHAP attributions presented in the next section are statistically robust and generalizable.

Variable importance and SHAP plots

The feature-importance results derived from the Random Forest models provide a detailed picture of how design parameters shaped performance in each climate. The rankings underscore the climate-dependence of courtyard optimization and highlight the relative dominance of specific envelope and geometric variables.

In Cairo, discomfort outcomes were dominated by construction type (41%), followed by WWR (30%). Orientation (15%) and glazing (10%) had moderate contributions. For energy, WWR became the leading variable (60%), with construction second (21%). These findings suggest that in hot–dry Cairo, both WWR and insulation placement critically determine comfort and energy use, with glazing and orientation exerting secondary effects, check Fig. 13.

Fig. 13
figure 13

Energy and discomfort feature importance of Cairo.

In Riyadh, discomfort prediction was strongly driven by construction (58%), followed by WWR (23%), while glazing and orientation contributed about 10% and 7%, respectively. For energy, WWR dominated (56%), with construction also high at 29%. These dual influences indicate that in very hot–dry Riyadh, the interaction between WWR and insulation placement governs both energy demand and thermal comfort, check Fig. 14.

Fig. 14
figure 14

Energy and discomfort feature importance of Riyadh.

In Gizan, window-to-wall ratio (WWR) was overwhelmingly the strongest predictor for both discomfort (≈ 79%) and energy (≈ 87%). Orientation, glazing, and insulation placement had only minor influence, each contributing less than 7% to discomfort predictions and below 5% for energy. This result emphasizes that in humid-hot Gizan, façade WWR ratio largely dictates both comfort and energy outcomes, check Fig. 15.

Fig. 15
figure 15

Energy and discomfort feature importance of Gizan.

In Miami, WWR again led for both objectives, explaining 42% of discomfort variation and over 71% of energy. However, unlike Gizan, secondary variables played a larger role. Insulation placement accounted for nearly a quarter of discomfort prediction, while orientation explained about 19%, reflecting the importance of both insulation strategies and solar exposure control in very hot–humid contexts, check Fig. 16.

Fig. 16
figure 16

Energy and discomfort feature importance of Miami.

In Sevilla, insulation placement was again the leading predictor, with 52% of discomfort importance and nearly 60% for energy. Orientation was the next most important factor for discomfort (27%), whereas WWR explained 24% of energy outcomes. These results highlight the centrality of Insulation Placement assembly in the warm–Mediterranean context, but with orientation also playing a substantial role in shaping comfort, check Fig. 17.

Fig. 17
figure 17

Energy and discomfort feature importance of Sevilla.

Across all cities, geometric parameters (length, width, and derived area) consistently ranked lowest, typically contributing less than 3% of predictive power. This suggests that, within the proportional ranges tested, courtyard size ratios exert less influence than envelope and orientation factors. The combination of WWR, construction, and glazing emerges as the primary design space across climates, with orientation becoming decisive in humid regimes.

Taken together, the feature-importance profiles reveal three broad patterns. First, WWR dominates energy outcomes in nearly all cities, particularly Gizan, Miami, Cairo, and Riyadh. Second, insulation placement exerts greater influence on discomfort, especially in Cairo, Sevilla, and Riyadh, indicating the role of insulation placement in moderating diurnal swings. Third, orientation is critical in humid climates, most notably in Miami and Gizan, where exposure to solar radiation strongly determines performance. These findings reinforce the necessity of tailoring courtyard design prescriptions to climate, and they provide a robust basis for the SHAP analysis that follows, which clarifies the directional effects and thresholds of these variables.



Source link