Cloud computing is gaining a lot of attention, however, security is a major obstacle to its widespread adoption. Users of cloud services are always afraid of data loss, security threats and availability problems. Recently, machine learning-based methods of threat detection are gaining popularity in the literature with the advent of machine learning techniques. Therefore, the study and analysis of threat detection and prevention strategies are a necessity for cloud protection. With the help of the detection of threats, we can determine and inform the normal and inappropriate activities of users. Therefore, there is a need to develop an effective threat detection system using machine learning techniques in the cloud computing environment. In this paper, we present the survey and comparative analysis of the effectiveness of machine learning-based methods for detecting the threat in a cloud computing environment. The performance assessment of these methods is performed using tests performed on the UNSW-NB15 dataset. In this work, we analyse machine learning models that include Support Vector Machine (SVM), Decision Tree (DT), Naive Bayes (NB), Random Forests (RF) and the K-Nearest neighbour (KNN). Additionally, we have used the most important performance indicators, namely, accuracy, precision, recall and F1 score to test the effectiveness of several methods.