## 4 Results
### Model Accuracy Validation  
This paper utilizes the remaining 20% of the sample data as a validation set and employs Root Mean Squared Error (RMSE), Mean Absolute Error (MAE), and Coefficient of Determination (R\({}^{2}\)) as evaluation metrics to assess the accuracy of the optimal models constructed using different tuning methods. Specifically, RMSE is commonly used to measure the proximity between the predicted values and the actual values. A smaller RMSE value indicates more accurate predictions by the model. MAE is the average of the absolute differences between predicted values and actual values, commonly used to measure the average magnitude of errors in model predictions. R\({}^{2}\) can be used to measure how well a model explains the target variable. Its values range from 0 to 1. The closer it is to 1, the better the explanation degree of the model. The formula of each indicator is as follows:  
\[RMSE=\sqrt{\frac{1}{n}{\sum_{i=1}^{n}(y_{i}-\hat{y}_{i})}^{2}}, \tag{7}\]  
\[MAE=\frac{1}{n}{\sum_{i=1}^{n}}|y_{i}-\hat{y}_{i}|, \tag{8}\]  
\[R^{2}=\frac{\sum_{i=1}^{n}(\hat{y}_{i}-\overline{y})^{2}}{\sum_{i=1}^{n}(y_{i} -\overline{y})^{2}}, \tag{9}\]  
In Formulas (7)-(9), \(y_{i}\) is the true value, \(\hat{y}_{i}\) is the predicted value, \(\overline{y}\) is the average of the true values, and \(n\) is the total number of samples. The results are summarized in Table 6, revealing that the model obtained through Bayesian optimization algorithm based on Gaussian processes exhibits the highest R\({}^{2}\) and the lowest RMSE, with values of 0.936 and 116.034 million people per square kilometer, respectively. Meanwhile, the Bayesian optimization algorithm based on gradient boosting regression trees achieves the lowest MAE; its value is 76.403 million people per square kilometer. In order to analyze the accuracy of the models and the distribution of errors, we performed fitting regression analysis and error statistics on the model prediction results and the real values. The outcomes are depicted as scatter plots of predicted vs. actual values and histograms of errors distribution, as shown in Figures 10-15. In the scatter plots, \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Tuning Method** & **R\({}^{2}\)** & **MAE** & **RMSE** \\ \hline Random search & 0.9209 & 84.6478 & 129.2998 \\ Grid search & 0.9151 & 85.6674 & 133.9270 \\ Genetic algorithm & 0.9027 & 93.4762 & 143.3880 \\ simulated annealing & 0.9295 & 80.8391 & 122.0234 \\ Bayesian optimization based on Gaussian process & 0.9363 & 76.4410 & 116.0342 \\ Bayesian optimization based on gradient boosting regression trees & 0.9361 & 76.4304 & 116.1700 \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Accuracy validation results of RF model based on different optimization methods. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline  & **n\_Estimators** & **Max\_Features** & **Max\_Depth** & **Min\_Samples\_Split** & **Min\_Samples\_Leaf** & **R2\_Score** \\ \hline Random search & 267 & 3 & 14 & 2 & 1 & 0.9690 \\ Grid search & 150 & 5 & 15 & 2 & 1 & 0.9707 \\ Genetic algorithm & 211 & 6 & 11 & 2 & 1 & 0.9444 \\ Simulated annealing algorithm & 153 & 3 & 21 & 4 & 1 & 0.9619 \\ Bayesian optimization based on Gaussian process & 100 & 3 & 23 & 2 & 1 & 0.9699 \\ Bayesian optimization based on gradient boosting regression trees & 102 & 3 & 17 & 2 & 1 & 0.9701 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Results of different parameter optimization methods on the training set. Figure 14: The prediction accuracy scatter diagram (**left**) and error distribution histogram (**right**) of RF model optimized with Bayesian optimization based on Gaussian process. Figure 13: The prediction accuracy scatter diagram (**left**) and error distribution histogram (**right**) of RF model optimized with Simulated annealing algorithm. Figure 15: The prediction accuracy scatter diagram (**left**) and error distribution histogram (**right**) of RF model optimized with Bayesian optimization based on gradient boosting regression trees.