With the development of the supply-side reform of road transportation in China and the rapid development of public transportation, the pressure of public security management is also increasing. According to the statistics of public transport safety accidents, the number of public transport accidents and deaths accounts for about 1% of the total number of relevant road traffic accidents in China, among which 93% of bus accidents are caused by drivers’ traffic violations. And, therefore, in order to predict the dangerous driving behavior of public transportation driver, this project combines the driver factors and environmental factors such as weather, road conditions, using the gradient promotion tree algorithm to forecast the risk in the process of public transportation to drive, to achieve the advance management and intervention of public traffic safety, to avoid major public traffic safety accidents, It provides ideas and deployment direction for public security traffic management.