**3. Results and Discussion**

#### *3.1. Analysis of Final Energy Consumption for Heating Buildings*

The analyzed buildings are heated from the municipal heating network. Therefore, information on actual heat consumption for heating in the three heating seasons before and after the thermal modernization was obtained. On this basis, calculations of final energy demand for heating were made, and then the energy characteristics of objects in the state before and after thermal modernization were determined. To exclude seasonal fluctuations, the actual energy consumption values obtained were converted (corrected) to standard season conditions (multi-year average). The data concerning the heating season degree days (from the years 2010–2018 and the multiannual average) based on which the calculations were carried out were taken from the climate database Eurostat [58] for the Małopolska region.

The amount of final energy consumption was calculated using the formula:

$$Q\_{K,H} = \sum\_{i=1}^{3} \frac{HDD(t\_b)\_i}{HDD(t\_b)\_0} \cdot Q\_{K,Hi}, \frac{1}{3} \tag{5}$$

where: *QK,H* —the final energy demand for the heating season, [kWh]; *HDD(tb)0*—the number of degree days in a standard heating season, [oCd]; *HDD(tb)i*—the number of degree days for the "i" of this year, [oCd]; *QK,H i*—final energy consumption for heating in a measurement period for the "i" of this year, [kWh].

The index of final energy demand for heating before and after the implementation of the improvement was calculated according to the formula:

$$FE = \frac{Q\_{K,H}}{A\_H} \tag{6}$$

where: *FE*—index of final energy demand for heating, [kWh·m<sup>−</sup>2·year<sup>−</sup>1]; *QK,H*—the final energy demand for the heating season, [kWh]; *AH*—calculated area of temperature-controlled rooms (heated surface), [m2].

The energy characteristics of the analyzed group of buildings in the state before FE0 and after FE1 thermal modernization are shown in Figure 3. Figure 4 shows the structure of buildings in terms of energy consumption.

**Figure 3.** Index of final energy demand for heating of buildings before and after implementing improvements.

**Figure 4.** Structure of buildings due to the size of the energy demand indicator for heating (**a**) before (**b**) after the improvement.

Index of final energy demand for heating of buildings is very varied. In buildings before modernization, it was between 83–569 [kWh·m<sup>−</sup>2·year−1], while after the improvement, it was 51–389 [kWh·m<sup>−</sup>2·year<sup>−</sup>1].

The average value of the index before modernization was 287 [kWh·m<sup>−</sup>2·year<sup>−</sup>1]; after the improvement, it decreased to 144 [kWh·m<sup>−</sup>2·year<sup>−</sup>1]. Average final energy consumption for heating an "average building" in Poland determined on the basis of a standard reference calculation based on EN ISO 13790/seasonal method [21] is: for buildings before thermal modernization 265.6 [kWh·m<sup>−</sup>2·year<sup>−</sup>1], while energy consumption after the improvement is 77.9 [kWh·m<sup>−</sup>2·year<sup>−</sup>1].

Nearly half of the buildings before the thermal modernization were characterized by energy consumption in the range 164–245 [kWh·m<sup>−</sup>2·year<sup>−</sup>1]. In the group of improved buildings, the largest group is made up of buildings where the energy demand for heating is between 99–147 [kWh·m<sup>−</sup>2·year<sup>−</sup>1].

Comparing the average values of the FE0 actual energy consumption index in the studied group of buildings with theoretical values, it can be seen that for existing buildings they are similar, whereas for improved buildings they di ffer. The projected energy consumption in a thermally improved "average building" based on standard reference calculations [46] is twice lower than the actual values.

#### *3.2. Modeling the Consumption of Thermal Energy in Buildings Undergoing Energy Modernization*

In the first part of the prediction model construction, the database was randomly divided into a teaching set and a test set. The input data characterizing the buildings were then divided into groups of variables Set I to Set IV. For individual groups from the learning set, the reducts and the core of the set of attributes were determined, which were used to create an inference model. The built model was subjected to a critical analysis (on the test set) in terms of accuracy and quality of the built forecast. The working space, on the basis of which the analyses were performed, is shown in Figure 2.

The results of quality and accuracy calculations of the constructed models depending on the selected set of input variables are shown in Table 3.


**Table 3.** Assessment of model of energy demand indicator for heating based on studied set of input variables (Set I to Set IV).

Analysis of the mean absolute values of the actual deviation of the final energy demand indicator for heating of residential buildings from the predicted value indicates that the model based on set IV has the lowest deviation value (18.1 kWh·m<sup>−</sup>2·year<sup>−</sup>1).

The highest error value (about 25.3 kWh·m<sup>−</sup>2·year<sup>−</sup>1) was shown by the model based on set III. The error value for the model based on the set I and II is similar and amounts to about 23 kWh·m<sup>−</sup>2·year<sup>−</sup>1.

The analysis of the MAPE error on the test set confirmed the usefulness of the model for determining the size of the energy demand indicator for heating for the building after thermal modernization. The obtained average error values for the selected Sets ranged from 14% to 17.8%.

The values of the two other meters used to assess the correctness of the models are as follows:

The MBE error values indicate that the energy consumption forecasts obtained from the model are overestimated for sets I, III and IV. The lowest value of the indicator (−0.73%) is obtained for set I, the highest (−16%) for set III. The model based on set II undervalued the actual values on average by 1.68%. The assessment of the energy demand indicator model expressed in the RSME CV ranges from 18.2% (Set II) to 32.2% (Set III).

Bearing in mind ASHARE's recommendations for model calibration, it can be concluded that three models based on data sets meet the requirements. These are the models based on sets I, II and IV. The best values for the assessment indicators can be observed for the set II model and then for set I. An analysis of the assessment indicators (MBE and CV RSME, which are considered together) showed that the best value of the assessment indicators can be obtained for set II and then for set I. Set IV has a CV RMSE value close to set II, but the MBE value is clearly di fferent from the others.

Taking all four assessment indicators into account, it can be seen that the best fit values are found for the model using the first set of variables.
