Python calls Baidu API interface to crawl the newly opened data of rail transit lines corresponding to each housing address, and for the raw data containing many interfering information, it is processed with data cleaning and quantization, followed by screening the spatial feature variables based on Pearson correlation coefficient. In order to improve the prediction accuracy and generalization ability of the algorithm combination, the three algorithms XgBoost, LightGBM and CatBoost in the Boosting series of algorithms are selected as the primary learners of the prediction model, and the prediction model based on machine learning is constructed. The research data and prediction models are assembled to examine the mechanism of the role of the opening of new rail transit lines on price fluctuations in the housing market. The correlation values of the four types of spatial characteristic variables of rail transit are 0.06, -0.112, -0.33, and -0.164, respectively, which concludes that the opening of new lines of subway transportation has the greatest role in influencing the housing market price, and it provides a reference for the prediction of the housing market price; in addition, the integrated error rate of the prediction model is 0.3697%, which indicates that the model has an excellent performance in the prediction of the housing market price, and it helps to urban planning, design and construction economy to a more desirable direction.