Heat pumps are becoming an increasingly popular choice for energy-efficient heating and cooling, especially as the world seeks to reduce reliance on fossil fuels. However, like all mechanical systems, heat pumps can experience problems that impact their performance and lifespan. One common issue is short compressor cycles, where the compressor turns on and off too frequently, leading to inefficiencies, higher energy bills, and potential damage to the system.In this thesis, the focus is on using machine learning to automatically detect these short compressor cycles by analyzing the vast amounts of data generated by heat pumps. The data is collected through sensors embedded in the system, which continuously monitor various operational parameters. By using supervised learning algorithms such as Extreme Gradient Boosting (XGBoost), Random Forest (RF), k-Nearest Neighbors (k-NN) and Support Vector Machine (SVM), this study aims to identify when a heat pump is experiencing problems and classify whether the compressor is running normally or encountering faults.The results show that machine learning models can be highly effective in fault detection, with XGBoost performing the best among the tested models. This research demonstrates how AI can help improve the maintenance and efficiency of heat pumps by detecting issues early, potentially lowering maintenance costs and reducing energy waste. The study highlights the importance of data-driven approaches in maintaining the reliability of modern heating systems, paving the way for smarter, more sustainable solutions in the future.