Machine learning (ML) and the internet of things (IoT) are among the most booming research directions. Smart cities, smart campuses (SCs), smart homes, smart cars, early warning systems (EWSs), etc.; or it could be called ''Smart x'' systems are implemented using ML and IoT. Those systems will alter how various world entities communicate with one another. This paper spots light on the significant roles of the IoT in SS. Also, it focuses on the importance of ML in IoT-based SS. Besides, an overview of smartness and IoT is presented. Then, this paper offers ML benchmarking along with a taxonomy that categorizes the ML models into linear and non-linear ones depending on the problem type (classification or regression). Afterward, the commonly utilized evaluation metrics are provided. In addition, this paper considers the trust techniques used for mitigating different security aspects in IoT networks, which play a crucial part in regulating the new era of communication. Moreover, two case studies devoting ML for IoT-based SS, namely IoT-based SC and IoT-based EWS, are considered for data collection and manipulation with guided research directions. Finally, the paper presents effective recommendations of ML's significant roles in SC and earthquake EWS for interested scholars.INDEX TERMS Machine learning, Internet of Things, smart systems, security.