The document presents a new machine learning-based framework for intrusion detection and prevention in the Internet of Things (IoT), addressing significant security challenges. It combines supervised and unsupervised learning techniques to enhance accuracy and reduce the time required for threat detection, achieving an improved detection accuracy of approximately 99.21%. The proposed system aims to mitigate the limitations of existing approaches by implementing a semi-supervised learning model focused on effective data analysis and feature selection.