# Prediction of House Price Index Based on Bagging Integrated WOA-SVR Model

Authors: Xiang Wang; Shen Gao; Shiyu Zhou; Yibin Guo; Yonghui Duan; Daqing Wu
Journal: Mathematical Problems in Engineering
 (2021)

---

## Abstract

Aiming at the shortcomings of a single machine learning model with low model prediction accuracy and insufficient generalization ability in house price index prediction, a whale algorithm optimized support vector regression model based on bagging ensemble learning method is proposed. Firstly, gray correlation analysis is used to obtain the main influencing factors of house prices, and the segmentation forecasting method is used to divide the data set and forecast the house prices in the coming year using the data of the past ten years. Secondly, the whale optimization algorithm is used to find the optimal parameters of the penalty factor and kernel function in the SVR model, and then, the WOA-SVR model is established. Finally, in order to further improve the model generalization capability, a bagging integration strategy is used to further integrate and optimize the WOA-SVR model. The experiments are conducted to forecast the house price indices of four regions, Beijing, Shanghai, Tianjin, and Chongqing, respectively, and the results show that the prediction accuracy of the proposed integrated model is better than the comparison model in all cases.


---

## Body

## 1. Introduction

As a pillar industry of the national economy, real estate plays an indispensable role in promoting China’s economic development. In the past decade, real estate has developed at a high speed in the Chinese economic system. According to the data released by the National Bureau of Statistics, the residential investment in real estate development in China in 2020 reached RMB10.444 trillion, which rose 206.99% compared to RMB 3.402 trillion ten years ago. In recent years, in order to maintain the stability and healthy development of real estate market prices, local governments have formulated a series of policies to restrict purchasing and loaning. Therefore, strengthening long-term monitoring and accurately predicting real estate market prices is an important guideline for homebuyers to grasp the timing of home purchasing and for government departments to formulate future housing prices control policies.Previous research on house price forecasting models has been divided into two kinds of econometric models and machine learning models. In econometric models, most models use historical prices to predict future house prices. The common models are Autoregressive Integrated Moving Average Model (ARIMA), Generalized AutoregRessive Conditional Heteroscedasticity model (GARCH), and Vector Autoregressive Models (VAR). For example, Zhao et al. [1] used the ARIMA model and multiple linear regression (MLR) model to forecast New Zealand house prices, respectively, and the experimental results showed that the ARIMA model generally outperformed the MLR model. Hou and Qiao [2] used wavelet analysis to decompose and reconstruct the house price data of Taiyuan city and used ARIMA to forecast each component obtained from the decomposition. Wang [3] used a GARCH model to analyze the long-term equilibrium relationship between house prices and CPI in Beijing and to forecast the trend of house price changes in Beijing. Li et al. [4] used a high-dimensional sparse VAR model to study the problem of house price forecasting in 35 large and medium-sized cities in China, and the experimental results showed that the proposed model has a more streamlined structure and better forecasting results compared to the traditional VAR model. However, the above econometric models mostly use house price data as a time series for linear forecasting, which is difficult to capture the nonlinear part of the data and has poor forecasting accuracy [5].Compared to econometric models, machine learning models are effective in mining and retaining valuable information in the data and in dealing with the nonlinear part of the data [6]. Among the most widely used machine learning models are BP neural networks and support vector regression (SVR) models. However, the BP neural network model has the defects of slow convergence, easy to fall into local extremes, and large demand for training samples and is prone to overfitting. SVR is a regression prediction model based on the principle of structural risk minimization, which performs well under small sample and high-dimensional data sample conditions with better generalization and nonlinear fitting ability compared to BP neural network models [7]. In previous studies, Ye et al. [8] proposed a wavelet Lp-norm support vector (Lp-WSVR) to improve the ability of feature selection and prediction accuracy in house price prediction problems. Han and Clemmensen [9] improved the SVR model by adding weights to the relaxation variables and experimentally demonstrated that the improved method has high accuracy and can effectively reduce the effect of outliers. Dong et al. [10] used Baidu search data as input data to predict second-hand and new house prices in 16 large and medium-sized cities in China, and the experimental results showed that the SVR model performed the best. However, when using the SVR model for regression prediction, the model prediction accuracy is usually influenced by the parameter settings, and the metaheuristic algorithm can quickly lock the optimal parameters of the model and improve the prediction accuracy of the SVR model. In a previous study, Pai and Hong [11] first used a genetic algorithm to optimize the parameters of SVM and experimentally proved that the proposed model can effectively improve prediction accuracy. Liu and Hong [12] used a particle swarm algorithm to optimize the parameters of the least squares support vector regression model and used the optimized model to forecast house price data. Tang et al. [13] used the bat algorithm to optimize the SVR model parameters and combined it with web search data to build a combined model to forecast the Beijing second-hand house price index.In the above studies, most of them are improved from the SVR model itself or from the data selection point of view, and the essence of their predictions is all predictions of a single model. However, a single machine learning model has poor generalization ability when making predictions, which makes it difficult to achieve high-precision predictions for house price data. The ensemble learning models combine multiple homogeneous or heterogeneous base learners into one strong learner through different learning strategies, which can achieve secondary learning of the prediction results and improve the generalization ability of the prediction model. Among them, the bagging ensemble learning strategy combines the results of multiple homogeneous base learners by parallel learning, which can effectively reduce the variance of model prediction and improve the prediction accuracy and has been used in several industries. For example, Choi and Jin [14] used a bagging integration strategy for predicting solar energy output and performed bagging integration by using random forest, XGBoost, and LightGBM models as base learners, respectively. The experimental results show that all the models after bagging integration can effectively improve the prediction accuracy. Yang et al. [15] proposed a bagging integrated extreme learning machine (ELM) to predict the path of tropical cyclones in the South China Sea and demonstrated experimentally that the integrated model has high generalization ability. Jung et al. [16] used bagging integrated multilayer perceptron (MLP) for electric load forecasting.In the light of the above analysis, this paper examines the house price index data of Beijing, Shanghai, Tianjin, and Chongqing from the following three perspectives. Firstly, we used literature analysis and gray correlation analysis to establish a house price index forecasting index system from three perspectives of macroeconomic environment, real estate industry, and market demand and used the segmented forecasting method to forecast the house price index in the coming year with the data information of the past ten years. Secondly, the SVR model is used for house price index prediction, and the whale optimization algorithm (WOA) is introduced into the parameter finding of the SVR model to establish the WOA-SVR model. Finally, the bagging ensemble learning strategy is used to integrate the WOA-SVR model for prediction in order to further improve the generalization ability and prediction accuracy of the model.The remainder of this paper is organized as follows. Section2 introduces the SVR, WOA, and bagging methods and then describes the prediction principles of the proposed combined model. Section 3 first introduces the indicator system of the four sets of house price index data and the idea of segmented forecasting and then introduces the parameter settings chosen for the model in this paper. Section 4 performs the model prediction performance analysis. Section 5 summarizes some conclusions.


## 2. Materials and Methods

### 2.1. Support Vector Regression Model

Support Vector Machine (SVM) [17] is a machine learning model constructed based on the principle of structural risk minimization. Support Vector Regression (SVR) model is a prediction algorithm when SVM performs regression modeling. The SVR model generalizes well and has an excellent ability to solve nonlinear and small sample prediction problems. The basic principle of the model is shown in the following.Given a set of training samplesN = {(x1, y1), (x2, y2), …, (xn, yn)} with the independent variable x and the dependent variable y, the expression of the characteristic function of the SVR model can be defined as follows:(1)y=fx=ωθx+b,θ:Rn⟶F,ω∈F,b∈R,where θ(x) is the mapping function, ω is the weight coefficient, and b is the deviation term.To ensure that the SVR model achieves linear differentiation on a high-dimensional space and minimizes the empirical risk, insensitive loss functions (ε) and relaxation variables (ξi,ξi∗≥0) need to be added to the model. Therefore, the objective function and constraints of the SVR model after adding the slack variables and loss functions can be defined as(2)min12‖ω2‖+C∑i=1nξi+ξi∗,(3)s.t.yi−ωθx−b≤ε+ξi,ξi,ξi∗≥0,where C is the penalty factor, which is usually used to regulate both the complexity of the model and the empirical risk,ξi and ξi∗ are the slack variables, and ε is the insensitivity factor.After introducing the Lagrange multipliersαi and αi∗, the SVR function model at this point can be represented as follows:(4)fx=∑i=1nαi−αi∗kxi,xj+b,where kxi,xj is the kernel function. Among the many kernel functions of the SVR model, the radial basis kernel function (RBF) is simple to calculate and has a better anti-interference ability for the noise present in the data, so the RBF kernel function is used in this paper, and the mathematical expression can be expressed as follows:(5)kxi,xj=exp−xi−xj22σ2,σ>0,where σ is the parameter of the kernel function. In practical engineering applications, the prediction performance of the SVR model is often closely related to the penalty factor C and the RBF kernel function parameter σ. Usually, C is used to adjust the model complexity, and it is easy to generate high model prediction error when C is not taken as appropriate. σ relates to the complexity of the sample mapping feature space and also affects the model prediction accuracy. Therefore, a reasonable choice of penalty factor and RBF kernel function parameters is essential for building the SVR model.


### 2.2. The Whale Optimization Algorithm

The whale optimization algorithm (WOA), first proposed in 2016 [18], is a population intelligence algorithm that evolves to simulate the natural hunting behavior of humpback whales with “spiral bubble nets.” The algorithm has the advantages of a few adjustable parameters, simple operation, and strong search capability and has been used in several industries. In the WOA, the position of each whale represents a candidate solution of the objective function, and the candidate solution is updated to find the optimal solution through three stages: encircling prey, spiral search, and random search, until the global optimal solution is found. The following is a detailed description of the three location update phases.


#### 2.2.1. Encircling Prey

In the prey encirclement phase, the whales first share the information about the location of the prey searched and then approach the whale closest to the current prey, gradually shrinking the encirclement. The corresponding whale position update equation in this phase is(6)Xt+1=X∗t−A⋅D,D=C⋅X∗t−Xt,where t is the current number of iterations of the algorithm; X is the whale position; X∗t is the current global optimal whale position; A and C are the coefficient matrices, which are calculated as(7)A=2a⋅r1−a,C=2r2,a=2−2ttmax,where a is the convergence factor that decreases linearly from 2 to 0, r1 and r2 are random numbers between the ranges [0,1], and tmax is the maximum number of iterations of the algorithm.


#### 2.2.2. Spiral Search

When searching for prey, the whale uses a spiral upward to slowly approach the prey, and the expression for this phase is(8)Xt+1=X∗t+D⋅eblcos2πl,D=C⋅X∗t−Xt,where b is a constant controlling the shape of the spiral, and l is a random number uniformly distributed between [−1,1].During the humpback whale’s rotational search, encircling the prey is performed simultaneously. Therefore, to simulate this simultaneous search, the WOA assumes a probability of 0.5 for each of these two position updating methods, with the following mathematical expression:(9)Xt+1=X∗t−A⋅D,p<0.5,X∗t+D⋅eblcos2πl,p≥0.5,where p is a random number between [0,1].


#### 2.2.3. Random Search

To enhance the global search capability of the algorithm, the WOA has a random search process to further expand the whale search range. When |A| ≥ 1, the whale is outside the envelope and the whale searches randomly away from the current location of the prey. When |A| < 1, the whale uses a spiral envelope to update the position. The mathematical principle of random search is expressed as(10)Xt+1=Xrandt−A⋅D∗,D∗=C⋅Xrandt−Xt,where Xrandt is the random position of the whale.


### 2.3. WOA-SVR

The parameter optimization process of the WOA for the SVR model is essentially to use the penalty factorC and the kernel function parameter σ in the SVR model as the position vector in the whale algorithm and to find the optimal SVR parameters through iterative updates of the WOA until the global optimal position is found as the final parameter of the SVR model. The computational process is described as follows:Step 1: initialize the algorithm parameters of WOA. Set the boundary of optimization-seeking parameters (ub and lb), the maximum number of iterations (tmax), and the population size (N) in WOA;Step 2: the position of each whale in the whale population is initialized, the mean square error function in the SVR model is used as the fitness function to calculate the fitness value results for each individual, and the position of the whale corresponding to the minimum adaptation value is selected as the optimal position in the current population. The fitness function can be defined by the following equation:(11)fxi=1n∑j=1nθi,j−θ^i,j2,wherexi is the ith individual position, θij is the jth true value in the training set, and θ^ij is the predicted value of the SVR model based on the parameters set by xi individuals.Step 3: update the whale position using equations (6), (8), and (10) and determine whether the updated whale position is within the position boundary or not, and if it is outside the boundary, generate the position randomly within the boundary.Step 4: when the position update is completed, the updated whale position is brought into the fitness function to calculate the fitness result and compared with the minimum fitness result generated by the last iteration, and the whale position corresponding to the minimum fitness result among them is selected as the current global optimal position.Step 5: repeat Step 3 and Step 4 and stop iteration when the maximum number of iterations is reached, at which time the global optimal position obtained is the optimal value of parameterC and σ.Step 6: the optimal parameters output by the WOA are brought into the SVR model for modeling.The detailed flow of the above steps is shown in Figure1.Figure 1
The flowchart of WOA-SVR.


### 2.4. Bagging Ensemble Learning Strategies

Ensemble learning methods usually use some kind of combination to combine the prediction results of multiple homogeneous or heterogeneous models and effectively improve the model generalization ability and prediction accuracy [19]. Among them, the bagging ensemble learning strategy aims to integrate the prediction results of multiple homogeneous base learners, and the combination of this strategy can effectively improve the model generalization ability and avoid the occurrence of the overfitting phenomenon. The basic concept of the Bagging ensemble learning strategy is to randomly sample the dataset using the Bootstrap method and export a number of subtraining sets of N equal size. Then, base learners are trained separately on the subtraining sets, and finally, the prediction results of base learners are arithmetically averaged to obtain the final prediction results. The prediction process is shown in Figure 2.Figure 2
The flowchart of bagging ensemble learning model.


### 2.5. Bagging Integrated WOA-SVR Model

The basic idea of integrating the WOA-SVR model is to use the WOA-SVR model as the base learner of the bagging strategy for ensemble learning, and its specific steps can be expressed as follows:Step 1: data preprocessing. Preprocess the data and divide the data into train set and test set.Step 2: bootstrap sampling. Divide the training set samples obtained in Step 1 intoN subtraining sets of equal sample size using Bootstrap.Step 3: fitting the subtraining set.N subtraining sets are fitted separately using the WOA-SVR model to obtain N base learners.Step 4: theN base learners are predicted separately for the test set data, and the prediction results of each base learner are arithmetically averaged to obtain the final prediction result of the integrated WOA-SVR model.The specific process is shown in Figure3.Figure 3
The flowchart of integrated WOA-SVR.


## 2.1. Support Vector Regression Model

Support Vector Machine (SVM) [17] is a machine learning model constructed based on the principle of structural risk minimization. Support Vector Regression (SVR) model is a prediction algorithm when SVM performs regression modeling. The SVR model generalizes well and has an excellent ability to solve nonlinear and small sample prediction problems. The basic principle of the model is shown in the following.Given a set of training samplesN = {(x1, y1), (x2, y2), …, (xn, yn)} with the independent variable x and the dependent variable y, the expression of the characteristic function of the SVR model can be defined as follows:(1)y=fx=ωθx+b,θ:Rn⟶F,ω∈F,b∈R,where θ(x) is the mapping function, ω is the weight coefficient, and b is the deviation term.To ensure that the SVR model achieves linear differentiation on a high-dimensional space and minimizes the empirical risk, insensitive loss functions (ε) and relaxation variables (ξi,ξi∗≥0) need to be added to the model. Therefore, the objective function and constraints of the SVR model after adding the slack variables and loss functions can be defined as(2)min12‖ω2‖+C∑i=1nξi+ξi∗,(3)s.t.yi−ωθx−b≤ε+ξi,ξi,ξi∗≥0,where C is the penalty factor, which is usually used to regulate both the complexity of the model and the empirical risk,ξi and ξi∗ are the slack variables, and ε is the insensitivity factor.After introducing the Lagrange multipliersαi and αi∗, the SVR function model at this point can be represented as follows:(4)fx=∑i=1nαi−αi∗kxi,xj+b,where kxi,xj is the kernel function. Among the many kernel functions of the SVR model, the radial basis kernel function (RBF) is simple to calculate and has a better anti-interference ability for the noise present in the data, so the RBF kernel function is used in this paper, and the mathematical expression can be expressed as follows:(5)kxi,xj=exp−xi−xj22σ2,σ>0,where σ is the parameter of the kernel function. In practical engineering applications, the prediction performance of the SVR model is often closely related to the penalty factor C and the RBF kernel function parameter σ. Usually, C is used to adjust the model complexity, and it is easy to generate high model prediction error when C is not taken as appropriate. σ relates to the complexity of the sample mapping feature space and also affects the model prediction accuracy. Therefore, a reasonable choice of penalty factor and RBF kernel function parameters is essential for building the SVR model.


## 2.2. The Whale Optimization Algorithm

The whale optimization algorithm (WOA), first proposed in 2016 [18], is a population intelligence algorithm that evolves to simulate the natural hunting behavior of humpback whales with “spiral bubble nets.” The algorithm has the advantages of a few adjustable parameters, simple operation, and strong search capability and has been used in several industries. In the WOA, the position of each whale represents a candidate solution of the objective function, and the candidate solution is updated to find the optimal solution through three stages: encircling prey, spiral search, and random search, until the global optimal solution is found. The following is a detailed description of the three location update phases.


### 2.2.1. Encircling Prey

In the prey encirclement phase, the whales first share the information about the location of the prey searched and then approach the whale closest to the current prey, gradually shrinking the encirclement. The corresponding whale position update equation in this phase is(6)Xt+1=X∗t−A⋅D,D=C⋅X∗t−Xt,where t is the current number of iterations of the algorithm; X is the whale position; X∗t is the current global optimal whale position; A and C are the coefficient matrices, which are calculated as(7)A=2a⋅r1−a,C=2r2,a=2−2ttmax,where a is the convergence factor that decreases linearly from 2 to 0, r1 and r2 are random numbers between the ranges [0,1], and tmax is the maximum number of iterations of the algorithm.


### 2.2.2. Spiral Search

When searching for prey, the whale uses a spiral upward to slowly approach the prey, and the expression for this phase is(8)Xt+1=X∗t+D⋅eblcos2πl,D=C⋅X∗t−Xt,where b is a constant controlling the shape of the spiral, and l is a random number uniformly distributed between [−1,1].During the humpback whale’s rotational search, encircling the prey is performed simultaneously. Therefore, to simulate this simultaneous search, the WOA assumes a probability of 0.5 for each of these two position updating methods, with the following mathematical expression:(9)Xt+1=X∗t−A⋅D,p<0.5,X∗t+D⋅eblcos2πl,p≥0.5,where p is a random number between [0,1].


### 2.2.3. Random Search

To enhance the global search capability of the algorithm, the WOA has a random search process to further expand the whale search range. When |A| ≥ 1, the whale is outside the envelope and the whale searches randomly away from the current location of the prey. When |A| < 1, the whale uses a spiral envelope to update the position. The mathematical principle of random search is expressed as(10)Xt+1=Xrandt−A⋅D∗,D∗=C⋅Xrandt−Xt,where Xrandt is the random position of the whale.


## 2.2.1. Encircling Prey

In the prey encirclement phase, the whales first share the information about the location of the prey searched and then approach the whale closest to the current prey, gradually shrinking the encirclement. The corresponding whale position update equation in this phase is(6)Xt+1=X∗t−A⋅D,D=C⋅X∗t−Xt,where t is the current number of iterations of the algorithm; X is the whale position; X∗t is the current global optimal whale position; A and C are the coefficient matrices, which are calculated as(7)A=2a⋅r1−a,C=2r2,a=2−2ttmax,where a is the convergence factor that decreases linearly from 2 to 0, r1 and r2 are random numbers between the ranges [0,1], and tmax is the maximum number of iterations of the algorithm.


## 2.2.2. Spiral Search

When searching for prey, the whale uses a spiral upward to slowly approach the prey, and the expression for this phase is(8)Xt+1=X∗t+D⋅eblcos2πl,D=C⋅X∗t−Xt,where b is a constant controlling the shape of the spiral, and l is a random number uniformly distributed between [−1,1].During the humpback whale’s rotational search, encircling the prey is performed simultaneously. Therefore, to simulate this simultaneous search, the WOA assumes a probability of 0.5 for each of these two position updating methods, with the following mathematical expression:(9)Xt+1=X∗t−A⋅D,p<0.5,X∗t+D⋅eblcos2πl,p≥0.5,where p is a random number between [0,1].


## 2.2.3. Random Search

To enhance the global search capability of the algorithm, the WOA has a random search process to further expand the whale search range. When |A| ≥ 1, the whale is outside the envelope and the whale searches randomly away from the current location of the prey. When |A| < 1, the whale uses a spiral envelope to update the position. The mathematical principle of random search is expressed as(10)Xt+1=Xrandt−A⋅D∗,D∗=C⋅Xrandt−Xt,where Xrandt is the random position of the whale.


## 2.3. WOA-SVR

The parameter optimization process of the WOA for the SVR model is essentially to use the penalty factorC and the kernel function parameter σ in the SVR model as the position vector in the whale algorithm and to find the optimal SVR parameters through iterative updates of the WOA until the global optimal position is found as the final parameter of the SVR model. The computational process is described as follows:Step 1: initialize the algorithm parameters of WOA. Set the boundary of optimization-seeking parameters (ub and lb), the maximum number of iterations (tmax), and the population size (N) in WOA;Step 2: the position of each whale in the whale population is initialized, the mean square error function in the SVR model is used as the fitness function to calculate the fitness value results for each individual, and the position of the whale corresponding to the minimum adaptation value is selected as the optimal position in the current population. The fitness function can be defined by the following equation:(11)fxi=1n∑j=1nθi,j−θ^i,j2,wherexi is the ith individual position, θij is the jth true value in the training set, and θ^ij is the predicted value of the SVR model based on the parameters set by xi individuals.Step 3: update the whale position using equations (6), (8), and (10) and determine whether the updated whale position is within the position boundary or not, and if it is outside the boundary, generate the position randomly within the boundary.Step 4: when the position update is completed, the updated whale position is brought into the fitness function to calculate the fitness result and compared with the minimum fitness result generated by the last iteration, and the whale position corresponding to the minimum fitness result among them is selected as the current global optimal position.Step 5: repeat Step 3 and Step 4 and stop iteration when the maximum number of iterations is reached, at which time the global optimal position obtained is the optimal value of parameterC and σ.Step 6: the optimal parameters output by the WOA are brought into the SVR model for modeling.The detailed flow of the above steps is shown in Figure1.Figure 1
The flowchart of WOA-SVR.


## 2.4. Bagging Ensemble Learning Strategies

Ensemble learning methods usually use some kind of combination to combine the prediction results of multiple homogeneous or heterogeneous models and effectively improve the model generalization ability and prediction accuracy [19]. Among them, the bagging ensemble learning strategy aims to integrate the prediction results of multiple homogeneous base learners, and the combination of this strategy can effectively improve the model generalization ability and avoid the occurrence of the overfitting phenomenon. The basic concept of the Bagging ensemble learning strategy is to randomly sample the dataset using the Bootstrap method and export a number of subtraining sets of N equal size. Then, base learners are trained separately on the subtraining sets, and finally, the prediction results of base learners are arithmetically averaged to obtain the final prediction results. The prediction process is shown in Figure 2.Figure 2
The flowchart of bagging ensemble learning model.


## 2.5. Bagging Integrated WOA-SVR Model

The basic idea of integrating the WOA-SVR model is to use the WOA-SVR model as the base learner of the bagging strategy for ensemble learning, and its specific steps can be expressed as follows:Step 1: data preprocessing. Preprocess the data and divide the data into train set and test set.Step 2: bootstrap sampling. Divide the training set samples obtained in Step 1 intoN subtraining sets of equal sample size using Bootstrap.Step 3: fitting the subtraining set.N subtraining sets are fitted separately using the WOA-SVR model to obtain N base learners.Step 4: theN base learners are predicted separately for the test set data, and the prediction results of each base learner are arithmetically averaged to obtain the final prediction result of the integrated WOA-SVR model.The specific process is shown in Figure3.Figure 3
The flowchart of integrated WOA-SVR.


## 3. Data Description

### 3.1. Selection of Data and Index System

This experiment uses data related to four cities within China, namely, Beijing, Shanghai, Tianjin, and Chongqing. In the four data sets, the new residential sales price index is used as the forecast label data to measure house price changes. At the same time, because there are many factors influencing housing prices, this paper establishes the primary index system of influencing factors of house price index through literature analysis method and uses gray correlation analysis method to select the index system and find out the important indexes influencing housing prices changes.


#### 3.1.1. Establishing a Primary Indicator System

The house price index is an indicator for quantitative analysis of the trend of real estate prices in the real estate market and is a set of indicators and analysis methods in the form of price indices to reflect the trajectory of changes in the real estate market and the current market conditions in a certain region. In this paper, we use the data of the sales price index of new residential units in 70 large and medium-sized cities published by the National Bureau of Statistics of China as the prediction labels for this experiment. Its calculation formula is defined by the following:(12)Hi,j=pti,jpt−1i,j∗100%,where Hi,j is the house price index; pt−1i,j is the average price of the jth basic classification of the ith item for period t−1 (last month); and pti,j is the average price in period t (this month).As for the influencing factors of the house price index, we use the literature search method to establish the primary index system of housing prices influencing factors. Firstly, we searched CNKI journals with the keyword of “analysis of influence factors of house prices” and got 31 core journals. Secondly, 31 core journals were further analyzed to remove journals that did not match the theme of this study, and a total of 16 valid papers were obtained. Finally, a detailed analysis of 16 literature studies was conducted to record the factors appearing more than 5 times, and finally, the indicators of housing prices influencing factors were grouped into the following three categories: macroeconomic environment factors, real estate industry factors, and market demand factors. The primary influencing factors are shown in Table1.Table 1
Primary indicators of factors influencing the house price index.
CategoryName of featuresDescriptionMacroeconomic environment factorsLInterestRateInterest rates for medium- and long-term loans (5 years or above)GDPGross domestic productCPIConsumer price indexERateIndexExchange rate indexM2Money supplyReal estate industry factorsAreacomCompleted area of commercial housesInvestmentcomInvestment in commercial housing developmentHPI_prPrior period house price indexMarket demand factorsIncomePer capita disposable annual income of urban householdsPopulationTotal population at the end of the year


#### 3.1.2. Grey Relation Analysis

Grey Relation Analysis (GRA) [20] is a method that measures the degree of association of the comparison series to the reference series by means of gray correlation. When the comparative series is more correlated, the series has a strong correlation with the reference series, and vice versa, the correlation is weak. The GRA process is as follows:Step 1: use the house price index dataYi = {yi1, yi2, …, yin} (i = 1, 2, …, n) as the reference series, and the panel data of house price influences Xj = {xj1, xj2, …, xjn} (j = 1, 2, …, n) as the comparison series.Step 2: normalization of the above sequences using the min-max method.Step 3: the gray correlation coefficients are calculated for each reference sequence and the comparison sequence. The formula is expressed as follows:(13)ξijk=miniminkxjk−yik+ρ⋅maximaxkxjk−yikxjk−yik+ρ⋅maximaxkxjk−yik,wherek = 1, 2, …, n; i = 1, 2, …, n; j = 1, 2, …, n; ρ is the resolution coefficient and takes the value range of (0,1); in this paper, we take ρ = 0.5.Step 4: calculate the correlation. The formula is(14)rij=1n∑k=1nξijk,whererij denotes the gray correlation between the comparison sequence and the reference sequence, and when the correlation result is closer to 1, it indicates that the comparison sequence has more influence on the reference sequence.The GRA result of the four cities’ house price index data and the panel data of influencing factors is shown in Table2. By analyzing the GRA results of the four cities in the table and removing the indicators whose correlation is less than 0.7, the final impact factor indicators obtained for each city are shown in Table 3.Table 2
GRA results.
FactorsBeijingShanghaiTianjinChongqingLInterestRate0.540.520.550.59GDP0.880.790.790.87CPI0.880.830.880.85ERateIndex0.810.760.810.79M20.920.870.900.87Areacom0.60.660.810.76Investmentcom0.810.850.890.81HPI_pr0.990.980.990.99Income0.840.820.860.88Population0.880.790.860.84Table 3
Final index system of the house price index.
CategoryBeijingShanghaiTianjinChongqingMacroeconomic environment factorsGDPGDPGDPGDPCPICPICPICPIERateIndexERateIndexERateIndexERateIndexM2M2M2M2Real estate industry factorsInvestmentcomInvestmentcomInvestmentcomInvestmentcomHPI_prHPI_prHPI_prHPI_prAreacomAreacomMarket demand factorsIncomeIncomeIncomeIncomePopulationPopulationPopulationPopulation


### 3.2. Data Sources

In this paper, we selected monthly data from January 2006 to December 2020 in Beijing, Shanghai, Tianjin, and Chongqing for the experiment. The indicator data in Table3 are published on the website of the National Bureau of Statistics, except for the ERateIndex, which is obtained from the wind database. Since the population is annual data, and GDP and income are quarterly data, Eviews10 software was used to convert the above three data to monthly. GDP, Investmentcom, and Areacom are affected by seasonal factors, and we choose the X-12 method for seasonal adjustment.Both the HPI and CPI are month-over-month scaled indices that only reflect the ratio of price changes in the current month to those in the previous month and do not reflect the long-term overall economic trend. By consulting the statistical rules of the National Bureau of Statistics for the two kinds of data, we choose equation (12) to transform the two kinds of data. Taking the data of HPI in Beijing as an example, assuming that the statistical price in January 2006 is 100 ￥/m2 and the HPI announced in February 2006 is 101.3, bringing it into equation (12) for the calculation to get the price of 101.3 ￥/m2 in February 2006. The value of HPI in March 2006 is 100.6, so the transformed March price is 101.9 ￥/m2. And so, the price index is transformed, and when the forecast is completed, it is restored back to the HPI according to equation (12). The data before and after the transformation are shown in Figure 4.Figure 4
Comparison before and after data transformation.


### 3.3. Prediction Method

In this paper, a segmented prediction method [21] is used for prediction. The overall idea is to train the model with a sample of data from the past ten years and predict the HPI in the coming year. Specifically, the first stage trains the model with data from January 2006 to December 2015 and predicts the HPI from January 2016 to December 2016. And so, the data set is finally divided into 5 segments and the last 5 years of data are predicted. The specific prediction process and the detailed time interval division of the data set are shown in Figure 5 and Table 4.Figure 5
Segmented prediction process.Table 4
Time interval division of data sets in different years.
Training setTesting set2006.1–2015.122016.1–2016.122007.1–2016.122017.1–2017.122008.1–2017.122018.1–2018.122009.1–2018.122019.1–2019.122010.1–2019.122020.1–2020.12After dividing the above five prediction stages, the data set for each stage is predicted using a rolling prediction method. The basic idea is that assuming that the value ofxt at moment t is related to the data of the previous d moments, the input vector for xt is {xt−1, xt−2, …, xt−d}, and the final prediction can be obtained by the mapping relation f:Rd⟶R. Its procedure is described as follows:(15)X=x1x2⋯xdx2x3⋯xd+1⋮⋮⋱⋮xmxm+1⋯xd+m−1,Y=xd+1xd+2⋯xd+m,where X is the input vector, Y is the output vector, and d is the spatial dimension of the input vector. In this paper, we take d = 3, which means that we use the data of the past quarter to predict the house price of the future month.


### 3.4. Experiment Preparation

#### 3.4.1. Data Preprocessing

In this paper, we use the panel data of housing price influencing factors in Table3 as input features and the transformed HPI data as output labels. And to eliminate the prediction errors due to the different data magnitudes, all predicted data are normalized by using (16)x∗=x−xminxmax−xmin,where x∗ is the normalized data value, x is the input data, and xmin and xmax are the minimum and maximum values of the input data.


#### 3.4.2. Performance Measurement

To test the predictive ability of the model, mean square error (MSE) and mean absolute error (MAE) were selected to evaluate the performance of prediction results in this experiment, as follows:(17)MSE=1n∑i=1nyi−yi^2,MAE=1n∑i=1nyi−yi^,where n represents the length of the data set, and yi and y^i represent the true and predicted values in the test set, respectively.


#### 3.4.3. Diebold–Mariano Test

MSE and MAE can be used as evaluation criteria for model prediction performance, but the prediction error between the two compared models may not be significant when performing regression prediction. Therefore, the Diebold–Mariano (DM) test is used in this paper to verify the statistical error in the out-of-sample prediction accuracy of the two comparison models. The general idea of the DM test is as follows: assume that the prediction errorui, t is expressed as(18)ui,t=y^i,t−yt,where y^i,t is the predicted value and yt is the true time series.In the DM test, the null hypothesis that there is no significant difference in the predictive ability of the two models isH0 : E(dt) = 0, where dt is the relative loss function between the models and the expression is dt=gu1,t−gu2,tandg⋅ is the loss function. The DM statistic is calculated as follows:(19)DM=d¯2πfd^0/T,where d¯=1/T∑t=1Tgu1,t−gu2,t is the mean value of the loss difference, and fd^0 denotes the consistent estimate of fd (0), which represents the spectral line density when the loss difference frequency is zero. In this paper, we use MSE and MAE as loss functions for DM tests, respectively.


#### 3.4.4. Model Selection and Parameter Setting

All experiments presented in this paper are implemented based on python 3.7 software, and multiple algorithms are used as comparison models to measure the prediction performance of the bagging-WOA-SVR model in four sets of house price data. For single-model prediction, DecisionTreeRegressor (DTR), BPNN, and SVR are used to compare and analyze the prediction effect of the WOA-SVR model. Among the integrated algorithms, Random Forest (RF), Bagging-BPNN, and Bagging-SVR models are selected to compare and analyze the prediction effect of the bagging-WOA-SVR model, where the range of WOA algorithm parameters is set from 0.001 to 10. The parameters of each model are shown in Table5.Table 5
Model parameter settings.
BeijingShanghaiTianjinChongqingBagging-WOA-SVRn_estimators = 13n_estimators = 28n_estimators = 10n_estimators = 15RFn_estimators = 36, max_depth = 2, min_samples_leaf = 0.26n_estimators = 30, max_depth = 2, min_samples_leaf = 0.3n_estimators = 30, max_depth = 2, min_samples_leaf = 0.3n_estimators = 18, max_depth = 2, min_samples_leaf = 0.32Bagging-BPNNn_estimators = 20n_estimators = 18n_estimators = 20n_estimators = 17Bagging-SVRn_estimators = 36n_estimators = 11n_estimators = 10n_estimators = 10Population size of WOA20101020Number of WOA iterations10050100100SVRDefultDefultDefultDefultBPNNNumber of neurons in the hidden layer = 13; batch_size = 256; epoch = 50Number of neurons in the hidden layer = 13; batch_size = 256; epoch = 50Number of neurons in the hidden layer = 13; batch_size = 256; epoch = 50Number of neurons in the hidden layer = 13; batch_size = 256; epoch = 50DTRDefultDefultDefultDefult


## 3.1. Selection of Data and Index System

This experiment uses data related to four cities within China, namely, Beijing, Shanghai, Tianjin, and Chongqing. In the four data sets, the new residential sales price index is used as the forecast label data to measure house price changes. At the same time, because there are many factors influencing housing prices, this paper establishes the primary index system of influencing factors of house price index through literature analysis method and uses gray correlation analysis method to select the index system and find out the important indexes influencing housing prices changes.


### 3.1.1. Establishing a Primary Indicator System

The house price index is an indicator for quantitative analysis of the trend of real estate prices in the real estate market and is a set of indicators and analysis methods in the form of price indices to reflect the trajectory of changes in the real estate market and the current market conditions in a certain region. In this paper, we use the data of the sales price index of new residential units in 70 large and medium-sized cities published by the National Bureau of Statistics of China as the prediction labels for this experiment. Its calculation formula is defined by the following:(12)Hi,j=pti,jpt−1i,j∗100%,where Hi,j is the house price index; pt−1i,j is the average price of the jth basic classification of the ith item for period t−1 (last month); and pti,j is the average price in period t (this month).As for the influencing factors of the house price index, we use the literature search method to establish the primary index system of housing prices influencing factors. Firstly, we searched CNKI journals with the keyword of “analysis of influence factors of house prices” and got 31 core journals. Secondly, 31 core journals were further analyzed to remove journals that did not match the theme of this study, and a total of 16 valid papers were obtained. Finally, a detailed analysis of 16 literature studies was conducted to record the factors appearing more than 5 times, and finally, the indicators of housing prices influencing factors were grouped into the following three categories: macroeconomic environment factors, real estate industry factors, and market demand factors. The primary influencing factors are shown in Table1.Table 1
Primary indicators of factors influencing the house price index.
CategoryName of featuresDescriptionMacroeconomic environment factorsLInterestRateInterest rates for medium- and long-term loans (5 years or above)GDPGross domestic productCPIConsumer price indexERateIndexExchange rate indexM2Money supplyReal estate industry factorsAreacomCompleted area of commercial housesInvestmentcomInvestment in commercial housing developmentHPI_prPrior period house price indexMarket demand factorsIncomePer capita disposable annual income of urban householdsPopulationTotal population at the end of the year


### 3.1.2. Grey Relation Analysis

Grey Relation Analysis (GRA) [20] is a method that measures the degree of association of the comparison series to the reference series by means of gray correlation. When the comparative series is more correlated, the series has a strong correlation with the reference series, and vice versa, the correlation is weak. The GRA process is as follows:Step 1: use the house price index dataYi = {yi1, yi2, …, yin} (i = 1, 2, …, n) as the reference series, and the panel data of house price influences Xj = {xj1, xj2, …, xjn} (j = 1, 2, …, n) as the comparison series.Step 2: normalization of the above sequences using the min-max method.Step 3: the gray correlation coefficients are calculated for each reference sequence and the comparison sequence. The formula is expressed as follows:(13)ξijk=miniminkxjk−yik+ρ⋅maximaxkxjk−yikxjk−yik+ρ⋅maximaxkxjk−yik,wherek = 1, 2, …, n; i = 1, 2, …, n; j = 1, 2, …, n; ρ is the resolution coefficient and takes the value range of (0,1); in this paper, we take ρ = 0.5.Step 4: calculate the correlation. The formula is(14)rij=1n∑k=1nξijk,whererij denotes the gray correlation between the comparison sequence and the reference sequence, and when the correlation result is closer to 1, it indicates that the comparison sequence has more influence on the reference sequence.The GRA result of the four cities’ house price index data and the panel data of influencing factors is shown in Table2. By analyzing the GRA results of the four cities in the table and removing the indicators whose correlation is less than 0.7, the final impact factor indicators obtained for each city are shown in Table 3.Table 2
GRA results.
FactorsBeijingShanghaiTianjinChongqingLInterestRate0.540.520.550.59GDP0.880.790.790.87CPI0.880.830.880.85ERateIndex0.810.760.810.79M20.920.870.900.87Areacom0.60.660.810.76Investmentcom0.810.850.890.81HPI_pr0.990.980.990.99Income0.840.820.860.88Population0.880.790.860.84Table 3
Final index system of the house price index.
CategoryBeijingShanghaiTianjinChongqingMacroeconomic environment factorsGDPGDPGDPGDPCPICPICPICPIERateIndexERateIndexERateIndexERateIndexM2M2M2M2Real estate industry factorsInvestmentcomInvestmentcomInvestmentcomInvestmentcomHPI_prHPI_prHPI_prHPI_prAreacomAreacomMarket demand factorsIncomeIncomeIncomeIncomePopulationPopulationPopulationPopulation


## 3.1.1. Establishing a Primary Indicator System

The house price index is an indicator for quantitative analysis of the trend of real estate prices in the real estate market and is a set of indicators and analysis methods in the form of price indices to reflect the trajectory of changes in the real estate market and the current market conditions in a certain region. In this paper, we use the data of the sales price index of new residential units in 70 large and medium-sized cities published by the National Bureau of Statistics of China as the prediction labels for this experiment. Its calculation formula is defined by the following:(12)Hi,j=pti,jpt−1i,j∗100%,where Hi,j is the house price index; pt−1i,j is the average price of the jth basic classification of the ith item for period t−1 (last month); and pti,j is the average price in period t (this month).As for the influencing factors of the house price index, we use the literature search method to establish the primary index system of housing prices influencing factors. Firstly, we searched CNKI journals with the keyword of “analysis of influence factors of house prices” and got 31 core journals. Secondly, 31 core journals were further analyzed to remove journals that did not match the theme of this study, and a total of 16 valid papers were obtained. Finally, a detailed analysis of 16 literature studies was conducted to record the factors appearing more than 5 times, and finally, the indicators of housing prices influencing factors were grouped into the following three categories: macroeconomic environment factors, real estate industry factors, and market demand factors. The primary influencing factors are shown in Table1.Table 1
Primary indicators of factors influencing the house price index.
CategoryName of featuresDescriptionMacroeconomic environment factorsLInterestRateInterest rates for medium- and long-term loans (5 years or above)GDPGross domestic productCPIConsumer price indexERateIndexExchange rate indexM2Money supplyReal estate industry factorsAreacomCompleted area of commercial housesInvestmentcomInvestment in commercial housing developmentHPI_prPrior period house price indexMarket demand factorsIncomePer capita disposable annual income of urban householdsPopulationTotal population at the end of the year


## 3.1.2. Grey Relation Analysis

Grey Relation Analysis (GRA) [20] is a method that measures the degree of association of the comparison series to the reference series by means of gray correlation. When the comparative series is more correlated, the series has a strong correlation with the reference series, and vice versa, the correlation is weak. The GRA process is as follows:Step 1: use the house price index dataYi = {yi1, yi2, …, yin} (i = 1, 2, …, n) as the reference series, and the panel data of house price influences Xj = {xj1, xj2, …, xjn} (j = 1, 2, …, n) as the comparison series.Step 2: normalization of the above sequences using the min-max method.Step 3: the gray correlation coefficients are calculated for each reference sequence and the comparison sequence. The formula is expressed as follows:(13)ξijk=miniminkxjk−yik+ρ⋅maximaxkxjk−yikxjk−yik+ρ⋅maximaxkxjk−yik,wherek = 1, 2, …, n; i = 1, 2, …, n; j = 1, 2, …, n; ρ is the resolution coefficient and takes the value range of (0,1); in this paper, we take ρ = 0.5.Step 4: calculate the correlation. The formula is(14)rij=1n∑k=1nξijk,whererij denotes the gray correlation between the comparison sequence and the reference sequence, and when the correlation result is closer to 1, it indicates that the comparison sequence has more influence on the reference sequence.The GRA result of the four cities’ house price index data and the panel data of influencing factors is shown in Table2. By analyzing the GRA results of the four cities in the table and removing the indicators whose correlation is less than 0.7, the final impact factor indicators obtained for each city are shown in Table 3.Table 2
GRA results.
FactorsBeijingShanghaiTianjinChongqingLInterestRate0.540.520.550.59GDP0.880.790.790.87CPI0.880.830.880.85ERateIndex0.810.760.810.79M20.920.870.900.87Areacom0.60.660.810.76Investmentcom0.810.850.890.81HPI_pr0.990.980.990.99Income0.840.820.860.88Population0.880.790.860.84Table 3
Final index system of the house price index.
CategoryBeijingShanghaiTianjinChongqingMacroeconomic environment factorsGDPGDPGDPGDPCPICPICPICPIERateIndexERateIndexERateIndexERateIndexM2M2M2M2Real estate industry factorsInvestmentcomInvestmentcomInvestmentcomInvestmentcomHPI_prHPI_prHPI_prHPI_prAreacomAreacomMarket demand factorsIncomeIncomeIncomeIncomePopulationPopulationPopulationPopulation


## 3.2. Data Sources

In this paper, we selected monthly data from January 2006 to December 2020 in Beijing, Shanghai, Tianjin, and Chongqing for the experiment. The indicator data in Table3 are published on the website of the National Bureau of Statistics, except for the ERateIndex, which is obtained from the wind database. Since the population is annual data, and GDP and income are quarterly data, Eviews10 software was used to convert the above three data to monthly. GDP, Investmentcom, and Areacom are affected by seasonal factors, and we choose the X-12 method for seasonal adjustment.Both the HPI and CPI are month-over-month scaled indices that only reflect the ratio of price changes in the current month to those in the previous month and do not reflect the long-term overall economic trend. By consulting the statistical rules of the National Bureau of Statistics for the two kinds of data, we choose equation (12) to transform the two kinds of data. Taking the data of HPI in Beijing as an example, assuming that the statistical price in January 2006 is 100 ￥/m2 and the HPI announced in February 2006 is 101.3, bringing it into equation (12) for the calculation to get the price of 101.3 ￥/m2 in February 2006. The value of HPI in March 2006 is 100.6, so the transformed March price is 101.9 ￥/m2. And so, the price index is transformed, and when the forecast is completed, it is restored back to the HPI according to equation (12). The data before and after the transformation are shown in Figure 4.Figure 4
Comparison before and after data transformation.


## 3.3. Prediction Method

In this paper, a segmented prediction method [21] is used for prediction. The overall idea is to train the model with a sample of data from the past ten years and predict the HPI in the coming year. Specifically, the first stage trains the model with data from January 2006 to December 2015 and predicts the HPI from January 2016 to December 2016. And so, the data set is finally divided into 5 segments and the last 5 years of data are predicted. The specific prediction process and the detailed time interval division of the data set are shown in Figure 5 and Table 4.Figure 5
Segmented prediction process.Table 4
Time interval division of data sets in different years.
Training setTesting set2006.1–2015.122016.1–2016.122007.1–2016.122017.1–2017.122008.1–2017.122018.1–2018.122009.1–2018.122019.1–2019.122010.1–2019.122020.1–2020.12After dividing the above five prediction stages, the data set for each stage is predicted using a rolling prediction method. The basic idea is that assuming that the value ofxt at moment t is related to the data of the previous d moments, the input vector for xt is {xt−1, xt−2, …, xt−d}, and the final prediction can be obtained by the mapping relation f:Rd⟶R. Its procedure is described as follows:(15)X=x1x2⋯xdx2x3⋯xd+1⋮⋮⋱⋮xmxm+1⋯xd+m−1,Y=xd+1xd+2⋯xd+m,where X is the input vector, Y is the output vector, and d is the spatial dimension of the input vector. In this paper, we take d = 3, which means that we use the data of the past quarter to predict the house price of the future month.


## 3.4. Experiment Preparation

### 3.4.1. Data Preprocessing

In this paper, we use the panel data of housing price influencing factors in Table3 as input features and the transformed HPI data as output labels. And to eliminate the prediction errors due to the different data magnitudes, all predicted data are normalized by using (16)x∗=x−xminxmax−xmin,where x∗ is the normalized data value, x is the input data, and xmin and xmax are the minimum and maximum values of the input data.


### 3.4.2. Performance Measurement

To test the predictive ability of the model, mean square error (MSE) and mean absolute error (MAE) were selected to evaluate the performance of prediction results in this experiment, as follows:(17)MSE=1n∑i=1nyi−yi^2,MAE=1n∑i=1nyi−yi^,where n represents the length of the data set, and yi and y^i represent the true and predicted values in the test set, respectively.


### 3.4.3. Diebold–Mariano Test

MSE and MAE can be used as evaluation criteria for model prediction performance, but the prediction error between the two compared models may not be significant when performing regression prediction. Therefore, the Diebold–Mariano (DM) test is used in this paper to verify the statistical error in the out-of-sample prediction accuracy of the two comparison models. The general idea of the DM test is as follows: assume that the prediction errorui, t is expressed as(18)ui,t=y^i,t−yt,where y^i,t is the predicted value and yt is the true time series.In the DM test, the null hypothesis that there is no significant difference in the predictive ability of the two models isH0 : E(dt) = 0, where dt is the relative loss function between the models and the expression is dt=gu1,t−gu2,tandg⋅ is the loss function. The DM statistic is calculated as follows:(19)DM=d¯2πfd^0/T,where d¯=1/T∑t=1Tgu1,t−gu2,t is the mean value of the loss difference, and fd^0 denotes the consistent estimate of fd (0), which represents the spectral line density when the loss difference frequency is zero. In this paper, we use MSE and MAE as loss functions for DM tests, respectively.


### 3.4.4. Model Selection and Parameter Setting

All experiments presented in this paper are implemented based on python 3.7 software, and multiple algorithms are used as comparison models to measure the prediction performance of the bagging-WOA-SVR model in four sets of house price data. For single-model prediction, DecisionTreeRegressor (DTR), BPNN, and SVR are used to compare and analyze the prediction effect of the WOA-SVR model. Among the integrated algorithms, Random Forest (RF), Bagging-BPNN, and Bagging-SVR models are selected to compare and analyze the prediction effect of the bagging-WOA-SVR model, where the range of WOA algorithm parameters is set from 0.001 to 10. The parameters of each model are shown in Table5.Table 5
Model parameter settings.
BeijingShanghaiTianjinChongqingBagging-WOA-SVRn_estimators = 13n_estimators = 28n_estimators = 10n_estimators = 15RFn_estimators = 36, max_depth = 2, min_samples_leaf = 0.26n_estimators = 30, max_depth = 2, min_samples_leaf = 0.3n_estimators = 30, max_depth = 2, min_samples_leaf = 0.3n_estimators = 18, max_depth = 2, min_samples_leaf = 0.32Bagging-BPNNn_estimators = 20n_estimators = 18n_estimators = 20n_estimators = 17Bagging-SVRn_estimators = 36n_estimators = 11n_estimators = 10n_estimators = 10Population size of WOA20101020Number of WOA iterations10050100100SVRDefultDefultDefultDefultBPNNNumber of neurons in the hidden layer = 13; batch_size = 256; epoch = 50Number of neurons in the hidden layer = 13; batch_size = 256; epoch = 50Number of neurons in the hidden layer = 13; batch_size = 256; epoch = 50Number of neurons in the hidden layer = 13; batch_size = 256; epoch = 50DTRDefultDefultDefultDefult


## 3.4.1. Data Preprocessing

In this paper, we use the panel data of housing price influencing factors in Table3 as input features and the transformed HPI data as output labels. And to eliminate the prediction errors due to the different data magnitudes, all predicted data are normalized by using (16)x∗=x−xminxmax−xmin,where x∗ is the normalized data value, x is the input data, and xmin and xmax are the minimum and maximum values of the input data.


## 3.4.2. Performance Measurement

To test the predictive ability of the model, mean square error (MSE) and mean absolute error (MAE) were selected to evaluate the performance of prediction results in this experiment, as follows:(17)MSE=1n∑i=1nyi−yi^2,MAE=1n∑i=1nyi−yi^,where n represents the length of the data set, and yi and y^i represent the true and predicted values in the test set, respectively.


## 3.4.3. Diebold–Mariano Test

MSE and MAE can be used as evaluation criteria for model prediction performance, but the prediction error between the two compared models may not be significant when performing regression prediction. Therefore, the Diebold–Mariano (DM) test is used in this paper to verify the statistical error in the out-of-sample prediction accuracy of the two comparison models. The general idea of the DM test is as follows: assume that the prediction errorui, t is expressed as(18)ui,t=y^i,t−yt,where y^i,t is the predicted value and yt is the true time series.In the DM test, the null hypothesis that there is no significant difference in the predictive ability of the two models isH0 : E(dt) = 0, where dt is the relative loss function between the models and the expression is dt=gu1,t−gu2,tandg⋅ is the loss function. The DM statistic is calculated as follows:(19)DM=d¯2πfd^0/T,where d¯=1/T∑t=1Tgu1,t−gu2,t is the mean value of the loss difference, and fd^0 denotes the consistent estimate of fd (0), which represents the spectral line density when the loss difference frequency is zero. In this paper, we use MSE and MAE as loss functions for DM tests, respectively.


## 3.4.4. Model Selection and Parameter Setting

All experiments presented in this paper are implemented based on python 3.7 software, and multiple algorithms are used as comparison models to measure the prediction performance of the bagging-WOA-SVR model in four sets of house price data. For single-model prediction, DecisionTreeRegressor (DTR), BPNN, and SVR are used to compare and analyze the prediction effect of the WOA-SVR model. Among the integrated algorithms, Random Forest (RF), Bagging-BPNN, and Bagging-SVR models are selected to compare and analyze the prediction effect of the bagging-WOA-SVR model, where the range of WOA algorithm parameters is set from 0.001 to 10. The parameters of each model are shown in Table5.Table 5
Model parameter settings.
BeijingShanghaiTianjinChongqingBagging-WOA-SVRn_estimators = 13n_estimators = 28n_estimators = 10n_estimators = 15RFn_estimators = 36, max_depth = 2, min_samples_leaf = 0.26n_estimators = 30, max_depth = 2, min_samples_leaf = 0.3n_estimators = 30, max_depth = 2, min_samples_leaf = 0.3n_estimators = 18, max_depth = 2, min_samples_leaf = 0.32Bagging-BPNNn_estimators = 20n_estimators = 18n_estimators = 20n_estimators = 17Bagging-SVRn_estimators = 36n_estimators = 11n_estimators = 10n_estimators = 10Population size of WOA20101020Number of WOA iterations10050100100SVRDefultDefultDefultDefultBPNNNumber of neurons in the hidden layer = 13; batch_size = 256; epoch = 50Number of neurons in the hidden layer = 13; batch_size = 256; epoch = 50Number of neurons in the hidden layer = 13; batch_size = 256; epoch = 50Number of neurons in the hidden layer = 13; batch_size = 256; epoch = 50DTRDefultDefultDefultDefult


## 4. Experiment and Discussion

### 4.1. Analysis of Model Prediction Effects

Tables6 to 9 show the prediction effects of MSE and MAE for each model in the four-city dataset, while in order to further analyze the prediction effects of each model, the table shows the prediction index values for each year and the 5-year sum together, where the bolded font indicates the model with the best prediction effect in that year.Table 6
Forecasting accuracy of house price index in Beijing.
MSEMAEYear 1Year2Year 3Year 4Year5All yearsYear 1Year 2Year 3Year 4Year 5All yearsBagging-WOA-SVR1.23580.40841.50651.32601.32601.16961.11170.48240.91281.22741.02430.9517Bagging-SVR4.29711.58492.55882.97322.36552.75592.01291.07321.49881.66151.48531.5463RF3.36570.27740.73055.43962.00012.36271.77150.25570.42791.92421.04381.0846Bagging-BPNN4.79932.60360.39031.57030.75122.02292.13251.47220.51011.19680.75081.2125WOA-SVR3.49191.87431.49302.36283.00091.81861.83481.36401.15201.53111.69221.2321SVR8.63111.10021.34802.47451.84853.08052.83980.96861.04121.52341.31781.5382DTR12.43912.90002.34595.85925.15735.74032.95871.40800.84011.49891.66501.6741BPNN11.01443.02942.64079.32916.46416.49602.74981.442171.25452.68531.91112.0087Table 7
Forecasting accuracy of house price index in Shanghai.
MSEMAEYear 1Year 2Year 3Year 4Year 5All yearsYear 1Year 2Year 3Year 4Year 5All yearsBagging-WOA-SVR0.81550.49480.56960.67740.98780.70900.90300.59560.63890.65110.87460.7326Bagging-SVR3.10951.12331.81951.83272.06661.91571.74890.97221.29761.32321.39741.3150RFR1.62130.35550.92362.88092.62311.68091.22880.25520.54551.39891.37210.9601Bagging-BPNN0.70907.22930.67330.46772.29522.27490.80772.67410.71840.58781.30761.2191WOA-SVR0.85410.42240.51570.77941.15780.74590.92410.51890.63660.67871.05510.7627SVR3.80001.02511.54411.68501.94622.00011.92670.82241.15791.22801.33751.2945DTR8.90160.17470.35830.51114.09072.80732.71980.27110.45090.59801.40231.0884BPNN7.56822.98681.56205.93799.44855.53042.26241.30661.13041.98712.53651.8489Table 8
Forecasting accuracy of house price index in Tianjin.
MSEMAEYear 1Year 2Year 3Year 4Year 5All yearsYear 1Year 2Year 3Year 4Year 5All yearsBagging-WOA-SVR0.13040.43950.37220.31870.18120.28840.36110.53020.61010.56440.42530.4982Bagging-SVR0.43650.90040.98930.79631.08360.84120.62560.78590.92590.78250.98660.8213RF0.81130.15830.55300.59040.61580.54580.90070.24130.51560.54460.60980.5624Bagging-BPNN0.29712.42910.23511.12690.20120.86320.48531.53970.42611.01940.37380.7722WOA-SVR0.37910.49860.32380.66990.23970.42220.56660.70260.56870.75940.48930.6173SVR0.42450.77651.17290.93120.99860.86070.57290.74040.96890.84620.91190.8081DTR1.13721.46632.13950.42950.35601.10571.02210.80260.77090.47280.45920.7055BPNN3.84431.31291.29821.71571.97362.02511.72550.89840.74631.13821.14821.1294Table 9
Forecasting accuracy of house price index in Chongqing.
MSEMAEYear 1Year 2Year 3Year 4Year 5All yearsYear 1Year 2Year 3Year 4Year 5All yearsBagging-WOA-SVR0.07710.13360.21340.31190.36810.22080.27110.36490.46190.55810.60660.4525Bagging-SVR0.40560.20220.59830.62380.41740.44940.49560.42110.70730.73990.61920.5966RF0.18380.23320.31370.48190.40470.32350.42230.47720.56010.68700.62350.5540Bagging-BPNN0.34171.08780.15570.13550.26130.39640.54110.96420.32750.32050.42690.5160WOA-SVR0.22070.26290.18780.40150.42940.30050.45880.51140.43340.63350.58810.5250SVR0.38500.19820.88690.69980.43620.52120.50140.39960.86290.78050.61740.6324DTR2.22370.69490.78931.28102.56171.51010.83140.64720.75051.05421.24250.9052BPNN1.38450.94051.43642.19682.07491.61100.87650.74581.08681.19731.08420.9981From the results in the table, it can be seen that, in the prediction index results of all years, the prediction results of the models after bagging integration are better than their corresponding single models, while the bagging-WOA-SVR model has the best prediction effect among the four data sets, which fully proves that the bagging integration strategy can effectively improve the model prediction accuracy. However, the bagging-WOA-SVR model does not always produce the best prediction results in each year’s forecasting, but the model is able to achieve high accuracy in predicting the house price index. For example, in the prediction results of the Beijing dataset, although the MSE results of the bagging-BPNN model in the third and fifth years performed well, in the first and second years’ predictions, the bagging-WOA-SVR improved by 74.25% and 84.31%, respectively, relative to the bagging-BPNN, which significantly outperformed the bagging-BPNN. Therefore, the bagging-WOA-SVR model has better stability and can achieve high accuracy forecasting of house price index data.In the single-model prediction, the WOA-SVR model performed the best in the four data sets. For example, in the Beijing dataset, the MSE index results of the WOA-SVR model for all years improved by 40.96% relative to the SVR model, which fully demonstrates that the parameter settings have a large impact on the prediction effect of the SVR model, and the SVR model optimized by WOA can effectively improve the prediction accuracy. Meanwhile, compared with DTR and BPNN, the accuracy of MSE of the WOA-SVR model improved by 68.32% and 72%, respectively, which proved that, compared with the neural network and decision tree model, the SVR model after parameter search has a better prediction effect when performing house price index prediction.The prediction curves of each model in the four data sets are shown in Figure6.Figure 6
Fitting curves for four cities. (a) Fitting curve of house price index in Beijing. (b) Fitting curve of house price index in Shanghai. (c) Fitting curve of house price index in Tianjin. (d) Fitting curve of house price index in Chongqing.
(a)(b)(c)(d)


### 4.2. DM Test

Table10 shows the DM test results of the bagging-WOA-SVR model over the other models in the four data sets. In the DM test, when the p value is less than 0.05, it indicates that the null hypothesis is rejected and the predictive ability of the two models is significantly different. The boldface values in the table indicate that the p value is less than 0.05. In order to directly express the predictive abilities of the bagging-WOA-SVR model and other models, the predictive ability is analyzed using the coverage ratio based on the DM results. The expression of coverage is as follows: the number of DM results rejecting the null hypothesis/the total number of DM results. When the models have similar predictive ability, there are fewer DM test results with p values less than 0.05 and the coverage rate is less than 50%; when the models have significantly better predictive ability than the benchmark model, there are more DM test results with p values less than 0.05 and the coverage rate is greater than 50%.Table 10
DM test results for bagging-WOA-SVR model and comparison model.
B-SVRRFB-BPNNWOA-SVRSVRDTRBPNNBeijingMSE5.4556e−070.00020.00721.6789e−070.00710.00630.0013MAE3.6952e-110.00310.00931.9554e−118.4994e−050.00082.2731e−05ShanghaiMSE1.1166e−081.3173e−060.00040.84862.8626e−060.00090.0008MAE1.7460e−144.0219e−050.00020.60443.1764e−100.00147.0947e−06TianjinMSE2.3444e−079.0037e−050.00010.09440.00070.06230.0093MAE1.6335e−090.00302.2904e-050.00414.7335e−070.01722.5020e−05ChongqingMSE0.00302.2542e−080.00370.01220.00070.09960.0154MAE7.1201e−051.5571e−100.01570.00041.6134e−050.00190.0001In this way, further analysis of the DM test results in Table10 reveals that the DM coverage of the bagging-WOA-SVR model is 100%, 85.71%, 92.86%, and 92.86% in the four data sets, respectively, whichproves that the bagging-WOA-SVR model significantly outperforms the proposed benchmark model in most cases; therefore, the proposed integrated model in this paper is statistically significant.


### 4.3. Feature Importance Analysis

To identify the most influential house price factors in making house price index forecasts for the four cities, the permutation_importance function in the sklearn package is used to perform a feature importance analysis on the WOA-SVR model that performs the best in single-model forecasting. Among them, since this paper uses a segmented forecasting method to forecast the 5-year house price index of the four cities and uses a rolling forecast for each stage to forecast the house price index of the future month with the characteristic data of the past quarter, the same characteristics of different months are numbered when performing the characteristic importance analysis. As an example of the house price index for the previous period, HPI_pr_1, HPI_ pr_2, and HPI_ pr_3 are used to represent the house price index from the first to the third month of the quarter.The characteristics of the WOA-SVR model that rank the top 5 in importance for each year when forecasting the five-year house price index for the four cities are listed in Table11 to 14. Further analysis of the results shows the following.Table 11
Feature importance analysis of Beijing dataset.
2016.1–2016.122017.1–2017.122018.1–2018.122019.1–2019.122020.1–2020.12FactorScoreFactorScoreFactorScoreFactorScoreFactorScoreHPI_pr_30.242815HPI_pr_30.43138HPI_pr_30.549026ERateIndex_10.004201HPI_pr_30.323126HPI_pr_20.071025ERateIndex _20.04204HPI_pr_10.076841ERateIndex_20.003756HPI_pr_20.04894ERateIndex _30.064863HPI_pr_20.032962ERateIndex_20.054605HPI_pr_30.003746HPI_pr_10.032421Investmentcom _30.058553M2 _20.031422ERateIndex_30.046494M2 _10.003728ERateIndex_20.027879M2 _20.051563ERateIndex_30.030907M2 _20.038579CPI_20.003727M2 _20.02218Table 12
Feature importance analysis of Shanghai dataset.
2016.1–2016.122017.1–2017.122018.1–2018.122019.1–2019.122020.1–2020.12FactorScoreFactorScoreFactorScoreFactorScoreFactorScoreHPI_pr_30.003742HPI_pr_30.5881HPI_pr_30.322272HPI_pr_30.547713HPI_pr_30.29674HPI_pr_20.002568HPI_pr_20.076124HPI_pr_20.08023HPI_pr_10.094856HPI_pr_20.096047HPI_pr_10.001568M2_10.037817HPI_pr_10.053294HPI_pr_20.084988HPI_pr_10.057768M2 _10.000676HPI_pr_10.037011CPI_30.016268M2_10.066755ERateIndex _30.016412Population _10.000393ERateIndex _30.014378M2_10.011593M2_20.058954CPI_20.008884Table 13
Feature importance analysis of Tianjin dataset.
2016.1–2016.122017.1–2017.122018.1–2018.122019.1–2019.122020.1–2020.12FactorScoreFactorScoreFactorScoreFactorScoreFactorScoreERateIndex _20.119247HPI_pr_30.073616HPI_pr_30.014421HPI_pr_30.341244HPI_pr_30.028759ERateIndex _30.109587HPI_pr_20.035202HPI_pr_20.007882HPI_pr_20.061115HPI_pr_20.020244M2 _30.096798ERateIndex _30.022461HPI_pr_10.005814ERateIndex _30.044221ERateIndex _30.019735CPI_10.089855HPI_pr_10.018916ERateIndex _20.003456CPI_30.043533ERateIndex _20.019326CPI_20.059374ERateIndex _20.008232ERateIndex _30.003325ERateIndex_20.035806ERateIndex _10.018893Table 14
Feature importance analysis of Chongqing dataset.
2016.1–2016.122017.1–2017.122018.1–2018.122019.1–2019.122020.1–2020.12FactorScoreFactorScoreFactorScoreFactorScoreFactorScoreHPI_pr_30.068482HPI_pr_30.045737HPI_pr_30.000103HPI_pr_30.011434HPI_pr_30.473192HPI_pr _20.027638HPI_pr _20.017391HPI_pr _20.000069HPI_pr _20.008818HPI_pr _20.185356CPI _20.022059ERateIndex _30.012543HPI_pr _20.000046HPI_pr _20.006055ERateIndex _30.047204ERateIndex _30.011095CPI_10.010967ERateIndex _30.000020ERateIndex _30.00249ERateIndex _10.033405CPI_10.009163CPI _20.010454ERateIndex _10.000011ERateIndex _20.001032M2 _20.013421(1) The house price index as a typical time series has characteristics such as stochasticity and trend, and information on the house price index in previous periods is usually the best source of information when forecasting the current period index. Thus, in the characteristic ranking results for all four cities, the previous period house price index appears in the top 5 when forecasting for each year, and the results show that HPI_pr_3, the previous period house price index closest to the forecasting month, is in the top of the characteristic ranking for all but Beijing 2019 and Tianjin 2016. (2) The exchange rate index is found in the top five characteristics of Beijing, Tianjin, and Chongqing, to varying degrees. Specifically, the influx of international capital will continue to increase liquidity in the financial markets, resulting in lower interest rates and lower purchase costs, to promote housing prices. (3) The results of ranking the importance of characteristics in Beijing and Shanghai show that money supply is also an important characteristic. The impact of money supply on housing prices is mainly manifested in the impact on interest rates. When the money supply increases, it leads to a decline in the market equilibrium interest rate, which is indirectly transmitted to the real estate industry. At the same time, the money supply will also have a direct impact on the real estate market. When the money supply changes, it will directly cause the price of raw materials for housing production to change, which will have an impact on housing prices. (4) In the feature ranking results of the four sets of data, in addition to the above three factors, CPI also plays an important role in the prediction of some years. CPI reflects the changes in the prices of consumer goods over a period of time, and usually, its rate of change can reflect the level of inflation in the region.


## 4.1. Analysis of Model Prediction Effects

Tables6 to 9 show the prediction effects of MSE and MAE for each model in the four-city dataset, while in order to further analyze the prediction effects of each model, the table shows the prediction index values for each year and the 5-year sum together, where the bolded font indicates the model with the best prediction effect in that year.Table 6
Forecasting accuracy of house price index in Beijing.
MSEMAEYear 1Year2Year 3Year 4Year5All yearsYear 1Year 2Year 3Year 4Year 5All yearsBagging-WOA-SVR1.23580.40841.50651.32601.32601.16961.11170.48240.91281.22741.02430.9517Bagging-SVR4.29711.58492.55882.97322.36552.75592.01291.07321.49881.66151.48531.5463RF3.36570.27740.73055.43962.00012.36271.77150.25570.42791.92421.04381.0846Bagging-BPNN4.79932.60360.39031.57030.75122.02292.13251.47220.51011.19680.75081.2125WOA-SVR3.49191.87431.49302.36283.00091.81861.83481.36401.15201.53111.69221.2321SVR8.63111.10021.34802.47451.84853.08052.83980.96861.04121.52341.31781.5382DTR12.43912.90002.34595.85925.15735.74032.95871.40800.84011.49891.66501.6741BPNN11.01443.02942.64079.32916.46416.49602.74981.442171.25452.68531.91112.0087Table 7
Forecasting accuracy of house price index in Shanghai.
MSEMAEYear 1Year 2Year 3Year 4Year 5All yearsYear 1Year 2Year 3Year 4Year 5All yearsBagging-WOA-SVR0.81550.49480.56960.67740.98780.70900.90300.59560.63890.65110.87460.7326Bagging-SVR3.10951.12331.81951.83272.06661.91571.74890.97221.29761.32321.39741.3150RFR1.62130.35550.92362.88092.62311.68091.22880.25520.54551.39891.37210.9601Bagging-BPNN0.70907.22930.67330.46772.29522.27490.80772.67410.71840.58781.30761.2191WOA-SVR0.85410.42240.51570.77941.15780.74590.92410.51890.63660.67871.05510.7627SVR3.80001.02511.54411.68501.94622.00011.92670.82241.15791.22801.33751.2945DTR8.90160.17470.35830.51114.09072.80732.71980.27110.45090.59801.40231.0884BPNN7.56822.98681.56205.93799.44855.53042.26241.30661.13041.98712.53651.8489Table 8
Forecasting accuracy of house price index in Tianjin.
MSEMAEYear 1Year 2Year 3Year 4Year 5All yearsYear 1Year 2Year 3Year 4Year 5All yearsBagging-WOA-SVR0.13040.43950.37220.31870.18120.28840.36110.53020.61010.56440.42530.4982Bagging-SVR0.43650.90040.98930.79631.08360.84120.62560.78590.92590.78250.98660.8213RF0.81130.15830.55300.59040.61580.54580.90070.24130.51560.54460.60980.5624Bagging-BPNN0.29712.42910.23511.12690.20120.86320.48531.53970.42611.01940.37380.7722WOA-SVR0.37910.49860.32380.66990.23970.42220.56660.70260.56870.75940.48930.6173SVR0.42450.77651.17290.93120.99860.86070.57290.74040.96890.84620.91190.8081DTR1.13721.46632.13950.42950.35601.10571.02210.80260.77090.47280.45920.7055BPNN3.84431.31291.29821.71571.97362.02511.72550.89840.74631.13821.14821.1294Table 9
Forecasting accuracy of house price index in Chongqing.
MSEMAEYear 1Year 2Year 3Year 4Year 5All yearsYear 1Year 2Year 3Year 4Year 5All yearsBagging-WOA-SVR0.07710.13360.21340.31190.36810.22080.27110.36490.46190.55810.60660.4525Bagging-SVR0.40560.20220.59830.62380.41740.44940.49560.42110.70730.73990.61920.5966RF0.18380.23320.31370.48190.40470.32350.42230.47720.56010.68700.62350.5540Bagging-BPNN0.34171.08780.15570.13550.26130.39640.54110.96420.32750.32050.42690.5160WOA-SVR0.22070.26290.18780.40150.42940.30050.45880.51140.43340.63350.58810.5250SVR0.38500.19820.88690.69980.43620.52120.50140.39960.86290.78050.61740.6324DTR2.22370.69490.78931.28102.56171.51010.83140.64720.75051.05421.24250.9052BPNN1.38450.94051.43642.19682.07491.61100.87650.74581.08681.19731.08420.9981From the results in the table, it can be seen that, in the prediction index results of all years, the prediction results of the models after bagging integration are better than their corresponding single models, while the bagging-WOA-SVR model has the best prediction effect among the four data sets, which fully proves that the bagging integration strategy can effectively improve the model prediction accuracy. However, the bagging-WOA-SVR model does not always produce the best prediction results in each year’s forecasting, but the model is able to achieve high accuracy in predicting the house price index. For example, in the prediction results of the Beijing dataset, although the MSE results of the bagging-BPNN model in the third and fifth years performed well, in the first and second years’ predictions, the bagging-WOA-SVR improved by 74.25% and 84.31%, respectively, relative to the bagging-BPNN, which significantly outperformed the bagging-BPNN. Therefore, the bagging-WOA-SVR model has better stability and can achieve high accuracy forecasting of house price index data.In the single-model prediction, the WOA-SVR model performed the best in the four data sets. For example, in the Beijing dataset, the MSE index results of the WOA-SVR model for all years improved by 40.96% relative to the SVR model, which fully demonstrates that the parameter settings have a large impact on the prediction effect of the SVR model, and the SVR model optimized by WOA can effectively improve the prediction accuracy. Meanwhile, compared with DTR and BPNN, the accuracy of MSE of the WOA-SVR model improved by 68.32% and 72%, respectively, which proved that, compared with the neural network and decision tree model, the SVR model after parameter search has a better prediction effect when performing house price index prediction.The prediction curves of each model in the four data sets are shown in Figure6.Figure 6
Fitting curves for four cities. (a) Fitting curve of house price index in Beijing. (b) Fitting curve of house price index in Shanghai. (c) Fitting curve of house price index in Tianjin. (d) Fitting curve of house price index in Chongqing.
(a)(b)(c)(d)


## 4.2. DM Test

Table10 shows the DM test results of the bagging-WOA-SVR model over the other models in the four data sets. In the DM test, when the p value is less than 0.05, it indicates that the null hypothesis is rejected and the predictive ability of the two models is significantly different. The boldface values in the table indicate that the p value is less than 0.05. In order to directly express the predictive abilities of the bagging-WOA-SVR model and other models, the predictive ability is analyzed using the coverage ratio based on the DM results. The expression of coverage is as follows: the number of DM results rejecting the null hypothesis/the total number of DM results. When the models have similar predictive ability, there are fewer DM test results with p values less than 0.05 and the coverage rate is less than 50%; when the models have significantly better predictive ability than the benchmark model, there are more DM test results with p values less than 0.05 and the coverage rate is greater than 50%.Table 10
DM test results for bagging-WOA-SVR model and comparison model.
B-SVRRFB-BPNNWOA-SVRSVRDTRBPNNBeijingMSE5.4556e−070.00020.00721.6789e−070.00710.00630.0013MAE3.6952e-110.00310.00931.9554e−118.4994e−050.00082.2731e−05ShanghaiMSE1.1166e−081.3173e−060.00040.84862.8626e−060.00090.0008MAE1.7460e−144.0219e−050.00020.60443.1764e−100.00147.0947e−06TianjinMSE2.3444e−079.0037e−050.00010.09440.00070.06230.0093MAE1.6335e−090.00302.2904e-050.00414.7335e−070.01722.5020e−05ChongqingMSE0.00302.2542e−080.00370.01220.00070.09960.0154MAE7.1201e−051.5571e−100.01570.00041.6134e−050.00190.0001In this way, further analysis of the DM test results in Table10 reveals that the DM coverage of the bagging-WOA-SVR model is 100%, 85.71%, 92.86%, and 92.86% in the four data sets, respectively, whichproves that the bagging-WOA-SVR model significantly outperforms the proposed benchmark model in most cases; therefore, the proposed integrated model in this paper is statistically significant.


## 4.3. Feature Importance Analysis

To identify the most influential house price factors in making house price index forecasts for the four cities, the permutation_importance function in the sklearn package is used to perform a feature importance analysis on the WOA-SVR model that performs the best in single-model forecasting. Among them, since this paper uses a segmented forecasting method to forecast the 5-year house price index of the four cities and uses a rolling forecast for each stage to forecast the house price index of the future month with the characteristic data of the past quarter, the same characteristics of different months are numbered when performing the characteristic importance analysis. As an example of the house price index for the previous period, HPI_pr_1, HPI_ pr_2, and HPI_ pr_3 are used to represent the house price index from the first to the third month of the quarter.The characteristics of the WOA-SVR model that rank the top 5 in importance for each year when forecasting the five-year house price index for the four cities are listed in Table11 to 14. Further analysis of the results shows the following.Table 11
Feature importance analysis of Beijing dataset.
2016.1–2016.122017.1–2017.122018.1–2018.122019.1–2019.122020.1–2020.12FactorScoreFactorScoreFactorScoreFactorScoreFactorScoreHPI_pr_30.242815HPI_pr_30.43138HPI_pr_30.549026ERateIndex_10.004201HPI_pr_30.323126HPI_pr_20.071025ERateIndex _20.04204HPI_pr_10.076841ERateIndex_20.003756HPI_pr_20.04894ERateIndex _30.064863HPI_pr_20.032962ERateIndex_20.054605HPI_pr_30.003746HPI_pr_10.032421Investmentcom _30.058553M2 _20.031422ERateIndex_30.046494M2 _10.003728ERateIndex_20.027879M2 _20.051563ERateIndex_30.030907M2 _20.038579CPI_20.003727M2 _20.02218Table 12
Feature importance analysis of Shanghai dataset.
2016.1–2016.122017.1–2017.122018.1–2018.122019.1–2019.122020.1–2020.12FactorScoreFactorScoreFactorScoreFactorScoreFactorScoreHPI_pr_30.003742HPI_pr_30.5881HPI_pr_30.322272HPI_pr_30.547713HPI_pr_30.29674HPI_pr_20.002568HPI_pr_20.076124HPI_pr_20.08023HPI_pr_10.094856HPI_pr_20.096047HPI_pr_10.001568M2_10.037817HPI_pr_10.053294HPI_pr_20.084988HPI_pr_10.057768M2 _10.000676HPI_pr_10.037011CPI_30.016268M2_10.066755ERateIndex _30.016412Population _10.000393ERateIndex _30.014378M2_10.011593M2_20.058954CPI_20.008884Table 13
Feature importance analysis of Tianjin dataset.
2016.1–2016.122017.1–2017.122018.1–2018.122019.1–2019.122020.1–2020.12FactorScoreFactorScoreFactorScoreFactorScoreFactorScoreERateIndex _20.119247HPI_pr_30.073616HPI_pr_30.014421HPI_pr_30.341244HPI_pr_30.028759ERateIndex _30.109587HPI_pr_20.035202HPI_pr_20.007882HPI_pr_20.061115HPI_pr_20.020244M2 _30.096798ERateIndex _30.022461HPI_pr_10.005814ERateIndex _30.044221ERateIndex _30.019735CPI_10.089855HPI_pr_10.018916ERateIndex _20.003456CPI_30.043533ERateIndex _20.019326CPI_20.059374ERateIndex _20.008232ERateIndex _30.003325ERateIndex_20.035806ERateIndex _10.018893Table 14
Feature importance analysis of Chongqing dataset.
2016.1–2016.122017.1–2017.122018.1–2018.122019.1–2019.122020.1–2020.12FactorScoreFactorScoreFactorScoreFactorScoreFactorScoreHPI_pr_30.068482HPI_pr_30.045737HPI_pr_30.000103HPI_pr_30.011434HPI_pr_30.473192HPI_pr _20.027638HPI_pr _20.017391HPI_pr _20.000069HPI_pr _20.008818HPI_pr _20.185356CPI _20.022059ERateIndex _30.012543HPI_pr _20.000046HPI_pr _20.006055ERateIndex _30.047204ERateIndex _30.011095CPI_10.010967ERateIndex _30.000020ERateIndex _30.00249ERateIndex _10.033405CPI_10.009163CPI _20.010454ERateIndex _10.000011ERateIndex _20.001032M2 _20.013421(1) The house price index as a typical time series has characteristics such as stochasticity and trend, and information on the house price index in previous periods is usually the best source of information when forecasting the current period index. Thus, in the characteristic ranking results for all four cities, the previous period house price index appears in the top 5 when forecasting for each year, and the results show that HPI_pr_3, the previous period house price index closest to the forecasting month, is in the top of the characteristic ranking for all but Beijing 2019 and Tianjin 2016. (2) The exchange rate index is found in the top five characteristics of Beijing, Tianjin, and Chongqing, to varying degrees. Specifically, the influx of international capital will continue to increase liquidity in the financial markets, resulting in lower interest rates and lower purchase costs, to promote housing prices. (3) The results of ranking the importance of characteristics in Beijing and Shanghai show that money supply is also an important characteristic. The impact of money supply on housing prices is mainly manifested in the impact on interest rates. When the money supply increases, it leads to a decline in the market equilibrium interest rate, which is indirectly transmitted to the real estate industry. At the same time, the money supply will also have a direct impact on the real estate market. When the money supply changes, it will directly cause the price of raw materials for housing production to change, which will have an impact on housing prices. (4) In the feature ranking results of the four sets of data, in addition to the above three factors, CPI also plays an important role in the prediction of some years. CPI reflects the changes in the prices of consumer goods over a period of time, and usually, its rate of change can reflect the level of inflation in the region.


## 5. Conclusions

This paper forecasts the house price indices based on four data sets in Beijing, Shanghai, Tianjin, and Chongqing. Firstly, the literature analysis method and gray correlation analysis method are used to establish the forecasting index system, and the segmented forecasting method is used to forecast the house price index in the coming year with the data information of the past ten years, and then, the bagging integrated WOA-SVR model is used to analyze the house price indices of the four cities in experimental simulations. Conclusions can be made as follows:(i)
Compared with other machine learning models, the bagging-WOA-SVR model proposed in this paper can effectively improve the prediction accuracy of the house price index. By analyzing the 5-year forecasting results of all models, the integrated model proposed in this paper has better stability and can achieve high-precision forecasting of house price indexes(ii)
The DM test with the comparison model on the four data sets found that the integrated model proposed in this paper has a higher coverage rate and significantly outperforms the comparison model in most cases, which is statistically significant(iii)
By analyzing the feature importance of the four cities, it is found that the house price index of the previous period closest to the forecast month, exchange rate index, M2, and CPI are important influencing factors affecting the forecast of the house price index



---

*Source: 3744320-2021-10-29.xml*