## 2 Materials and Methods
### Machine Learning Test Method
The goal of the OLS regression model is to find the optimal parameter values approximating the minimized cost function \(R\), which is described as follows:  
\[R=\frac{1}{2m}\sum_{i=1}^{m}r_{i}^{2}, \tag{2}\]  
where \(r_{i}\) denotes the residual, which is defined as the difference between the true value and the predicted value:  
\[r_{i}=P_{i}^{pred}-P_{i}^{true}, \tag{3}\]  
where \(P_{i}^{true}\) denotes the true value of the population in the \(i\)-th subdistrict. 2. Best Subset Linear Regression (BSR) Model  
The best subset method finds the optimal feature combination according to the cross-validation error by traversing all possible feature combinations. Since all possible feature combinations are traversed, the selected feature combinations should be optimal in theory. However, due to the method's need to fit 2P models (it is assumed that the model has p initial features), the computational cost is usually too large. From a computational point of view, the optimal subset method is only suitable for a maximum of 30-40 features. As the BSR algorithm is not implemented in scikit-learn 0.24.0 software, we had to loop all the subsets manually to find the best subset. The python code block of the BSR algorithm is shown in Table 2.  
3 Principal Component Regression (PCR) Model and Partial least squares (PLS) Regression Model Principal component analysis is a useful method for dealing with collinearity, which is one of the main causes of overfitting. First, the principal component analysis method eliminates the collinearity in the model through orthogonal transformation. Second, the principal component variables are used as independent variables for regression analysis. Finally, according to the score coefficient matrix, the original variables are substituted back into the new model. However, the regression model obtained with the principal components is not as easy to explain as the regression model established with the original independent variables. PLS regression is a combination of principal component analysis, canonical correlation, and multiple linear regression. 4 Lasso Regression Model, Ridge Regression Model, and Elastic Net Regression Model Regularization is also a method that is commonly used to prevent overfitting. The general principle is to add a constraint on the parameters after the cost function (\(R\)) to compress the regression coefficients of certain variables to zero, in order to achieve feature selection. The constraints are usually called regularized items. The regularized items usually include an L1 regularized item and an L2 regularized item. The L1 regularized item is the sum of the absolute values of all the parameters (excluding the intercept). The L2 regularized item is the sum of squares of all the parameters (excluding intercept). Lasso regression and Ridge regression are the L1 regularization and L2 regularization of least squares regression, respectively. The elastic net is the linear combination of the L1 norm and the L2 norm. The Grid Search functions of these models are provided by scikit-learn 0.24.0 software; they are named LassoCV, RidgeCV and ElasticCV, respectively. The cost function formulas of lasso regression, ridge regression, and elastic net regression are as follows, respectively:  
\[R_{lasso}=\frac{1}{2m}\Big{[}\sum_{i=1}^{m}{r_{i}}^{2}+\lambda\sum_{j=1}^{k} \left|\omega_{j}\right|\Big{]}, \tag{4}\]  
\[R_{ridge}=\frac{1}{2m}\Big{[}\sum_{i=1}^{m}{r_{i}}^{2}+\lambda\sum_{j=1}^{k} \omega_{j}^{2}\Big{]}, \tag{5}\]  
\[R_{elastic}=\frac{1}{2m}\Bigg{[}\sum_{i=1}^{m}{r_{i}}^{2}+\lambda_{1}\sum_{j= 1}^{k}{\omega_{j}}^{2}+\lambda_{2}\sum_{j=1}^{k}\omega_{j}^{2}\Bigg{]}, \tag{6}\]