## 4 Conclusions  
It is not possible to replace at once all heat meters currently being in use. Therefore, we need to characterize the existing devices much better to be able to implement the idea of smart buildings. The knowledge needed for data analysis and model building is available to researchers and fairly well established [43]. Access to large datasets containing information about the operation of already installed devices in residential buildings is currently relatively easy. The analysis of these data (in Sections 3.1 and 3.2) provided significantly new knowledge about their operation. This is as an intermediate step in the implementation of heat meters into smart buildings. The reliability of heat meters, especially of those with remote communication, seems to be good enough for smart city applications, and optimization of heat consumption (Figure 3 shows a failure rate around 11%). We discovered that the failure intensity of the heat meters was random and weakly dependent on the time of their use and followed a Weibull distribution (Section 3.2), which was in line with the studies on electricity meters [11]. In addition to statistical analysis, a selection of machine learning algorithms, including neural networks and an ensemble model for heat meters' failure prediction, was implemented. \begin{table}
\begin{tabular}{c c} \hline \hline
**Metric** & **Result** \\ \hline _MCC-S_ & 97.34\% \\ _AUC_ & 96.45\% \\ \(f1_{avg}\) & 98.22\% \\ \(f1_{1}\) & 95.81\% \\ \(f1_{0}\) & 98.82\% \\ \(Recall_{avg}\) & 98.32\% \\ \(Recall_{1}\) & 93.34\% \\ \(Recall_{0}\) & 99.56\% \\ \(Precision_{avg}\) & 98.15\% \\ \(Precision_{1}\) & 98.42\% \\ \(Precision_{0}\) & 98.08\% \\ _Accuracy_ & 98.15\% \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Ensemble classifier: average for 10 tries. Currently, most applications of machine learning are primarily based on neural networks. It is understandable that this method is very flexible and probably the only one suitable for solving many types of problems such as regression, classification, clustering, and reinforcement. Consequently, the alternative types of algorithms are rarely considered. We showed that prior exploratory data analysis, the right choice of parameters, hyperparameters' optimization, and building the ensemble classifier can significantly enhance the quality of predictions and create a solution that outperforms the results of an individual neural network. As studies using hyperparameter optimization are not common, this encouraged us to present this issue a bit more widely. We also showed that this is an important step to improve the efficiency of machine learning models. The presented data analysis and the results of created models led to the following findings and implications:  
* The intensity of failures of heat meters was almost independent of the operating time. * Due to the high reliability of the meters and their considerable cost, condition-based or predictive maintenance of heat meters was justified and possible. It was shown in Section 3.2 that the mandatory five-year verification period could be extended. * Collecting different parameters about devices in use made sense even if they are not required at the moment. This allowed building more general and better ML models in the future. * Heat meter data allowed building a ranking list of their producers and optimize deliveries. * Heat meters with remote communication were twice as reliable as the ones with manual reading. This article is one of the few that dealt with the reliability and predictability of heat meters' failures. It is also, according to our knowledge, the first attempt to use more independent ML models based on a single database. Achieving the result above 95% for the AUC metric by the model, while maintaining overfitting at the minimum level, was a remarkable outcome. As stated in [24], many ML methods are very sensitive to the type and quality of the data.