# Heat Loss Coefficient Estimation Applied to Existing Buildings through Machine Learning Models
## Materials and Methods
### Case Study Data Acquisition
#### 2.3.2 Pre-Processing Data  
This analysis is focused on the estimation of the HLC of a building. The data available in this study to train the machine learning models were hourly observations between March 2016 and December 2017 of four variables. The variables considered were two describing the thermal behaviour of the building (thermal demand and indoor temperatures) and two describing the climate conditions (outdoor temperature and solar radiation). In addition, to find significant hours when the heating worked normally, only the hours with a thermal demand of more than 5 kW were selected (n = 5727). In this case, it was not necessary to have a continuous sample because the training did not take into account time lags in \begin{table}
\begin{tabular}{c c c c c c} \hline \hline  & \multicolumn{4}{c}{**EXTERIOR WALLS**} \\ \hline Layer (Indoor-Outdoor) & Material & Thickness (cm) & \multicolumn{4}{c}{Properties} \\ \cline{3-6}  & & \(\lambda\) (W/m \(\cdot\) K) & c (kJ/kg \(\cdot\) K) & \(\rho\) (kg/m\({}^{3}\)) & R (h \(\cdot\) m\({}^{2}\cdot\) K/kJ) \\ \hline
1 & Plasterboard & 2 & 0.11 & 1 & 900 & - \\ \hline
2 & Extruded polystyrene & 4 & 0.03 & 1 & 31 & - \\ \hline
3 & Mineral wool & 6 & 0.04 & 1 & - & - \\ \hline
4 & Air & 4 & - & - & - & 0.05 \\ \hline
5 & Concrete & 25 & 1.15 & 1 & 1800 & - \\ \hline \multicolumn{6}{c}{**INTERIOR FLOOR**} \\ \hline Layer (Indoor-Outdoor) & Material & Thickness (cm) & \multicolumn{4}{c}{Properties} \\ \cline{3-6}  & & \(\lambda\) (W/m \(\cdot\) K) & c (kJ/kg \(\cdot\) K) & \(\rho\) (kg/m\({}^{3}\)) & R (h \(\cdot\) m\({}^{2}\cdot\) K/kJ) \\ \hline
1 & Extruded polystyrene & 4 & 0.03 & 1 & 31 & - \\ \hline
2 & Greenket & 2 & 0.10 & 1.6 & 300 & - \\ \hline
3 & Common concrete & 8 & 1.3 & 1 & 2000 & - \\ \hline
4 & Lightweight concrete & 6 & 0.34 & 1.1 & 600 & - \\ \hline
5 & Concrete block & 2 & 1.32 & 1 & 1330 & - \\ \hline \multicolumn{6}{c}{**SLAB**} \\ \hline Layer (Indoor-Outdoor) & Material & Thickness (cm) & \multicolumn{4}{c}{Properties} \\ \cline{3-6}  & & \(\lambda\) (W/m \(\cdot\) K) & c (kJ/kg \(\cdot\) K) & \(\rho\) (kg/m\({}^{3}\)) & R (h \(\cdot\) m\({}^{2}\cdot\) K/kJ) \\ \hline
1 & Extruded polystyrene & 4 & 0.03 & 1 & 31 & - \\ \hline
2 & Greenket & 2 & 0.10 & 1.6 & 300 & - \\ \hline
3 & Common concrete & 14 & 1.3 & 1 & 2000 & - \\ \hline
4 & Lightweight concrete & 6 & 0.34 & 1.1 & 600 & - \\ \hline
5 & Concrete block & 2 & 1.32 & 1 & 1330 & - \\ \hline \multicolumn{6}{c}{**ROOF**} \\ \hline Layer (Indoor-Outdoor) & Material & Thickness (cm) & \multicolumn{4}{c}{Properties} \\ \cline{3-6}  & & \(\lambda\) (W/m \(\cdot\) K) & c (kJ/kg \(\cdot\) K) & \(\rho\) (kg/m\({}^{3}\)) & R (h \(\cdot\) m\({}^{2}\cdot\) K/kJ) \\ \hline
1 & Plasterboard & 2 & 0.11 & 1 & 900 & - \\ \hline
2 & Extruded polystyrene & 3 & 0.03 & 1 & 31 & - \\ \hline
3 & Com on concrete & 10 & 1.3 & 1 & 2000 & - \\ \hline
4 & Reinforced concrete & 36 & 2.30 & 1 & 2400 & - \\ \hline
5 & Air & 5 & - & - & - & 0.044 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Composition and properties of the enclosures of the analysed building. the explanatory variables. Therefore, three time variables (hour of the year, day of the week, and hour of the day) were introduced into the models to provide more information and thus to improve the training. The variables that were used as model inputs are presented in Figure 2.  
The model fit was carried out through a cross-validation process in which the whole sample was divided consecutively into two individual samples: training and testing. In the search for the optimal model and the selection of hyperparameters, the models were tested with different partitions (or subsamples) of the whole training sample (\(k\)-fold = 10) [49].