## 8 Conclusions and Future Work  
This case study aimed to compare IF and VAE algorithms and to choose the best approach to develop and implement an anomaly detection system for hotel consumption. This system is intended to avoid unnecessary consumption or even detect malfunctions in the installations. During the study carried out on the data, there were some problems in the provided readings, which could interfere with the performance of the platform, such as: (i) problematic and (ii) missing readings. The solution found was the data correction module with statistical approaches, like the IQR method and LWMA. To evaluate the performance of the detection of anomalies in an unsupervised time series by IF and VAE algorithms, a performance metric was defined. Comparing the results obtained between the two algorithms, it was concluded that generally, the IF algorithm gave a better answer to the problem in the study, as it obtained a better balance in the test results compared to the VAE. For example, the average of the \(S_{final}\) of the IF algorithm was 0.89, while that of the VAE was 0.83. VAE, on the other hand, proved to be able to provide good detection results, including better results than IF in two situations, which may indicate the potential to solve problems, where generalization, the easy adaptability of the algorithm, and limited computational resources are not considered. In conclusion, the IF algorithm belongs to the ML algorithms of the unsupervised type, which means that it performs an analysis of unclassified data. This algorithm was able to answer the specific needs of this problem, demonstrating its capacity to detect artificially introduced anomalies, to have computationally less undemanding training, and to be very adaptable to the different types of variables that are available for analysis. In the future, it will be interesting to further explore the data processing component, evaluating new approaches and improving the actual solution to remove the problematic  
Figure 17: Real anomaly detection scenarios detected by the proposed system. The first scenario (**top**) is associated with a machinery failure, and the second one (**bottom**) is related to one water pump that started working on a new unnecessary regime. readings. Furthermore, testing alternative anomaly detection approaches could provide more accurate methods. For example, it could be interesting to employ active learning to overcome the unlabeled problem of the datasets, or use attention mechanisms in the deep learning approach to focus on the relevant parts of the time series sequences. Furthermore, the metric proposed to evaluate anomaly detection algorithms using unlabeled time series datasets has space to be improved. Conceptualization, T.M., P.J.S.C., J.M. and J.R.; methodology, T.M., P.J.S.C., J.M. and J.R.; software, T.M. ; validation, J.R.; formal analysis, T.M., P.J.S.C. and J.M. ; investigation, T.M., P.J.S.C. and J.M. ; resources, J.R.; data curation, T.M. and J.R.; writing--original draft preparation, T.M., P.J.S.C. and J.M. ; writing--review and editing, T.M., P.J.S.C. and J.M. ; visualization, T.M., P.J.S.C., J.M. and [PERSON]; supervision, [PERSON], [PERSON] and [PERSON]; project administration, [PERSON] and [PERSON]; funding acquisition, [PERSON] and [PERSON]. All authors have read and agreed to the published version of the manuscript. This research was supported by the European Union through CRESC ALGORVE 2020, Portugal 2020, and by the Portuguese Foundation for Science and Technology, project UIDB/50009/2020--LARSyS. Not applicable. We would like to thank the company \"Amago--Energia Inteligente\" for its involvement in the conceptualization, for providing the data which made this study possible, and for all the support during its realization. The authors declare no conflict of interest. The funders played no role in the design of the study; in the collection, analyses, or interpretation of the data; in the writing of the manuscript; or in the decision to publish the results.