Internet of Things (IoT) is bringing revolution into today’s world where devices in our surroundings become smart and perform daily-life activities and operations with more precision. The architecture of IoT is heterogeneous as it provides autonomy to nodes that they can communicate among other nodes and can also exchange information at any period. Due to the heterogeneous environment, IoT faces numerous security and privacy challenges, and one of the most significant challenges is the identification of malicious and compromised nodes. In this article, we have proposed a Machine Learning-based trust management approach for edge nodes. The proposed approach is a lightweight process to evaluate trust because edge nodes cannot perform complex computations. To evaluate trust, the proposed mechanism utilizes the knowledge and experience component of trust where knowledge is further based on several parameters. To eliminate the triumphant execution of good and bad-mouthing attacks, the proposed approach utilizes edge clouds, i.e., local data centers, to collect recommendations to evaluate indirect and aggregated trust. The trustworthiness of nodes is ranked between a certain limit where only those that satisfy the threshold value can participate in the network. To validate the performance of a proposed approach we have performed an extensive simulation in comparison with the existing approaches and the result shows the effectiveness of the proposed approach against several potential attacks.