With the rapid development of China's real estate market, the real estate industry has become a significant part of Chinese national economy. However, the high housing prices in the first-tier and new first-tier cities have forced many young people to turn their attention to the rental market, setting off an upsurge of housing rental. Based on the random forest model, this paper selects two cities, Shanghai and Wuhan, to study the price trend of the housing rental market and its influencing factors. Finally, it is found that the random forest regression model has no significant effect on the rental forecast in Shanghai. It may be that for a highly modernized first-tier city, the variables selected in this paper are not enough to fully explain the rental price. The prediction effect of rental price in Wuhan is significantly better, among which the characteristics of urban area and housing itself have a great impact on rental price. This research can serve as a reference for future researchers in the housing rental market, while helping landlords and tenants make optimal choices.