Abstract The purpose of this paper is to combine machine learning to locate the 3D sensor network space. Real life is mostly a three-dimensional environment. Whether it is a factory in manufacturing or a vegetation base in agriculture, it needs to be monitored and positioned. In this paper, the localization algorithm is discussed to a certain extent. This paper firstly introduces the relevant background and organizes related work. It also wrote related algorithms, such as ranging-based positioning algorithms in the free space of wireless sensors. It shows the positioning link by introducing the wireless sensor network structure system and node structure. And this paper summarizes the Bounding-box Method positioning principle, TDOA algorithm principle, and TDOA positioning principle. It then describes the gradient boosting tree classification algorithm based on machine learning, and focuses on the admiral boosting tree classification algorithm related to the experiment. This paper also describes the ranging technology combining RSSI algorithm and DV-Hop algorithm in three-dimensional space, and mentions two algorithms of RSSI and DV-Hop. In the fourth part, the machine learning coordinate prediction accuracy improvement experiment and the three-dimensional space positioning algorithm optimization experiment and result analysis are carried out. It is proved by experiments that the model evaluation effect of the gradient boosting tree classification algorithm in machine learning is the best. It can be applied to the calculation of relative position coordinates of label nodes. It then carried out the three-dimensional positioning effect test experiment of IDV-Hop algorithm. This shows that when the network density in the experimental environment reaches more than 12, the localization coverage of IDV-Hop algorithm and DV-Hop algorithm are both higher than 91%. Finally, the hybrid algorithm of RSSI and DV-Hop algorithm is used to compare the positioning accuracy, positioning coverage and bad node rate with these two algorithms. It draws the stability of the hybrid algorithm and its effects, and finally discusses and summarizes the experiments.