The population dynamics of a country do play a vital role in its economic and political development. The COVID-19 epidemic has significantly affected the world's population. However, most people only care about the negative influence caused by COVID-19 but ignore the positive influence. This article uses two machine learning models, the random forest model, and the linear regression model, to predict the population change in China if there were no COVID-19 pandemic. With the predicted results, this article can compare the potential positive impact of the pandemic. This paper tries to fit two popular models, namely, Random Roest and Linear Regression to forecast the population of China from 2020 to 2025. The historical birth rate, death rate, and GDP growth rate of China are collected as features adding to the models to decline the error. For the Random Forest model, this paper set up an ensemble of decision trees to predict the future population of China. For the Linear Regression model, our features and population fit a linear connection. The findings of two models are compared in this article, and it is suggested that the random forest model is more suited for population forecasting. In addition, according to this study, the COVID-19 pandemic has some favorable effects on economic growth and birth rates. The article emphasizes the need to not only focus on the negative effects of the pandemic. Furthermore, the article points out that the linear regression model has poor fitting results for non-linear relationships. It suggests exploring more non-linear models for prediction and considering more influential parameters.