The developments in hardware and wireless networks have brought humans to the brink of a new era in which small, wire-free devices will give them access to data at any time and any location and significantly contribute to the building of smart surroundings. Wireless Sensor Network (WSN) sensors collect data on the parameters they are used to detect. However, the performance of these sensors is constrained due to power and bandwidth limitations. In order to get beyond these limitations, they may use Machine Learning (ML) techniques. WSNs have witnessed a steady rise in the use of advanced ML techniques to distribute and improve network performance over the last decade. ML enthuses a plethora of real-world applications that maximize resource use and extend the network's life span. Furthermore, WSN designers have agreed that ML paradigms may be used for a broad range of meaningful tasks, such as localization and data aggregation as well as defect detection and security. This paper presents a survey of the ML models, as well as application in wireless networking and information processing. In addition, this paper evaluates the open challenges and future research directions of ML for WSNs.