# COVID-19 Propagation Prediction Model Using Improved Grey Wolf Optimization Algorithms in Combination with XGBoost and Bagging-Integrated Learning

Authors: Yonghui Duan; Yaqi Mao; Yibin Guo; Xiang Wang; Shen Gao
Journal: Mathematical Problems in Engineering
 (2022)

---

## Abstract

Toward solving the slow convergence and low prediction accuracy problems associated with XGBoost in COVID-19-based transmission prediction, a novel algorithm based on guided aggregation is presented to optimize the XGBoost prediction model. In this study, we collect the early COVID-19 propagation data using web crawling techniques and use the Lasso algorithm to select the important attributes to simplify the attribute set. Moreover, to improve the global exploration and local mining capability of the grey wolf optimization (GWO) algorithm, a backward learning strategy has been introduced, and a chaotic search operator has been designed to improve GWO. In the end, the hyperparameters of XGBoost are continuously optimized using COLGWO in an iterative process, and Bagging is employed as a method of integrating the prediction effect of the COLGWO-XGBoost model optimization. The experiments, firstly, compared the search means and standard deviations of four search algorithms for eight standard test functions, and then, they compared and analyzed the prediction effects of fourteen models based on the COVID-19 web search data collected in China. Results show that the improved grey wolf algorithm has excellent performance benefits and that the combined model with integrated learning has good prediction ability. It demonstrates that the use of network search data in the early spread of COVID-19 can complement the historical information, and the combined model can be further extended to be applied to other prevention and control early warning tasks of public emergencies.


---

## Body

## 1. Introduction

According to the World Health Organization, the new Coronavirus pneumonia outbreak constitutes a global public health emergency as of January 31, 2020 [1]. China has suffered great economic and social harm following the outbreak of Corona Virus Disease 2019 (COVID-19), in late December 2019 in Wuhan, China [2]. Considering that COVID-19 is highly infectious [3], its origin, transmission routes, and pathogenesis have remained unclear at the beginning of the outbreak, and the government's prevention and control strategy have been gradually and dynamically adapted to the epidemic's development. Scientific forecasting can help prevent major outbreaks by establishing a proactive and anticipatory safeguard system to prevent the continuous spread of epidemics [4]. The early identification of the epidemiological trend of COVID-19 will assist in controlling the spread and progression of the disease, thereby reducing its social burden. Therefore, it is important to examine a fast and efficient prediction model for major public emergencies to develop reasonable prevention and control measures.In COVID-19 epidemic prediction, scholars around the world used public data of the epidemic to conduct a variety of data analyses and tested a variety of prediction methods and prediction models. In combining and analyzing the categories and mechanisms of these models, it has been found that existing prediction methods can be broadly classified into three categories: curve-fitting methods, kinetic methods, and machine learning methods. Zhao et al. [5] were the first to make this prediction. They used curve-fitting based on exponential growth trends to predict the number of cases at the beginning of the outbreak and determined that the early transmission capacity of the novel coronavirus was similar to or slightly greater than the early transmission capacity of SARS. The traditional curve-fitting prediction methods are very different from reality because they do not consider the characteristics of infectious diseases. A kinetic model describes the speed, spatial extent, transmission pathways, and kinetic mechanisms of infectious diseases [6]. It is worth noting that the majority of kinetic models for the current epidemic are based on SEIR models. The authors of Geng et al. [7] created an SEIR model to evaluate the efficacy of current prevention and control strategies using the characteristics of COVID-19. To predict COVID-19 with reference to the spread of SARS in the absence of data, Wu et al. [8] added crowd flow rate to the traditional SEIR model. Nevertheless, although kinetic methods are good predictors of early trends in epidemics, they are insufficient to estimate the spread of disease in open mobile settings or allow the assumed constants of disease transmission capacity and cure probability to match reality. Hence, an analysis of epidemic trends based on these methods will be inaccurate over the long term [9]. Since the emergence of COVID-19, with the continual increase in data samples and the advent of big data, the superiority of technologies, such as artificial intelligence, has been fully apparent. Researchers Peng et al. [10] employed four machine learning models for the prediction of clinical outcomes: artificial neural networks (ANN), naive Bayesian models (NBM), logistic regression (LR), and random forest (RF) models. The study by Liu et al. [11] constructed LR, k-nearest neighbor (KNN), decision tree (DT), multilayer perceptron (MLP), random forest (RF), support vector machines (SVM), and explainable boosting machine (EBM), a total of seven COVID-19 diagnostics, and evaluated the accuracy of each model for COVID-19. Ji et al. [12] developed a new particle swarm algorithm (ADVPSO) to optimize the parameters of ANN and applied it to predicting the spread trend of COVID-19. Using RF and ANN, Balerjee et al. [13] developed a predictive model for neo-coronavirus pneumonia based on the results of complete blood counts in admitted patients. The model was able to identify 85% of community neo-coronavirus-positive patients without considering patient symptoms or medical history. Using daily data from the Iranian Ministry of Health between February 19 and March 30, 2020, Moftakhar et al. [14] built ARIMA and ANN models, respectively, to forecast the number of confirmed patients to be confirmed in Iran within the next month. A study by Almazroi et al. [15] demonstrated that popular machine learning algorithms, such as ANN and DT, have high variance and bias in prediction and used four integrated models of gradient boosting decision tree (GBDT), RF, extreme gradient boosting (XGBoost), and voting regressors (VR) to predict the number of new coronary pneumonia cases in Saudi Arabia each day. The XGBoost model was found to be the strongest predictor. It is the advantage of machine learning methods that they can learn and train from historic data to construct an intelligent prediction model for the development of the epidemic. Not only does the prediction effect depend on the quality of the prediction model but also on the data used for the prediction. Online public opinion [16] is an important vehicle for the dissemination of emergency information in the context of big data. Following the outbreak of an emergency, internet users often learn about the event through search engines or portals. Ginsberg et al. [17] became the first to propose such a study. They utilized Google’s extensive user search data to accurately predict the trend of the proportion of influenza-like cases in the United States one week in advance using the “Google Flu Trends” software developed by Google in 2008. A subsequent study was conducted by some scholars as a follow up to this. Signorini et al. [18] calculated a real-time tracking prediction model for the proportion of influenza-like illnesses across the U.S. and in specific regions using the percentage of U.S. Twitter volume containing influenza-related keywords published within the U.S. as a predictor variable. Li et al. [19] noted that the web searches of historical data can better predict influenza trends, while the web searches of current data can ensure the accuracy of predictions of new changes. A few scholars have also utilized internet search data in the analysis and study of the current epidemic. In some parts of the United States, Kurian et al. [20] found a strong correlation between searches on Google Trends and outbreaks of new corona infections.Overall, different attempts have been made to address the prediction problem of COVID-19 in the existing literature, however, some limitations remain. Firstly, traditional methods of curve-fitting and kinetic analysis have the shortcomings of having low prediction accuracy and poor generalization properties. Secondly, most of the data used in the existing literature are traditional statistical data, which present problems associated with long acquisition periods and poor timeliness, affecting prediction models’ timeliness. Thirdly, although machine learning techniques are widely employed in COVID-19 prediction, most scholarly studies apply them to predicting COVID-19 diagnosis, whereas there is little literature specifically addressing the prediction of the new corona epidemic trend.This paper attempts to address the shortcomings listed above by focusing on the following three aspects of COVID-19 epidemic transmission prediction problem.In the first step, the COVID-19 network opinion keyword database is developed using relevant references, the Baidu search index keyword time series data is crawled, and keywords that have high correlation are screened out as input features of the machine learning model using the LASSO algorithm.Next, the final keywords are input into the XGBoost model. To increase the accuracy of the prediction, a chaotic search factor is designed, and a backward learning strategy is introduced to create an improved grey wolf evolutionary algorithm (COLGWO). Using the algorithm, the hyperparameters of the XGBoost model are determined, and then the COLGWO-XGBoost model as a prediction study of the change in the cumulative number of confirmed COVID-19 cases in China is performed.The third point is that, to further improve the generalization performance of COLGWO-XGBoost, a combined Bagging-COLGWO-XGBoost early warning model is proposed based on Bagging’s idea of integrated learning. Such a model includes multiple benchmark models and performance evaluation metrics to provide a more scientific and comprehensive assessment of the proposed model.


## 2. Web Search Data

### 2.1. Data Collection

We used the cumulative number of confirmed diagnoses nationwide as the prediction label here, which was obtained using the DXY website’s (https://www.dxy.cn) interface (excluding Hong Kong, Macau, and Taiwan). Data began with the first national notification on the official website of the National Health and Wellness Commission of the People’s Republic of China. As of January 20, 2020, to May 7, 2020, the period ranged from the time the national prevention and control work was mostly in the normalization stage [21], with a total of 110 valid observations.The internet generates more data with greater timeliness with the development of information technology and the penetration of networks. During an outbreak, people will turn to search engines, such as Baidu and Google, to seek information about the outbreak’s cause and the corresponding preventive measures. Utilizing open-source web search data to monitor the new corona epidemic in China is a powerful addition to traditional surveillance tools and can serve as an early warning system, guide medical treatment, and improve prevention and control strategies during the incipient stages of the epidemic. China’s most frequently used search engine Baidu has a feature called Baidu search index that counts the daily search volume figures for various keywords. It can effectively reflect a keyword’s media and user attention at a specific point in time and reflect the network public opinion change in an emergency situation [22]. According to the Baidu index, daily statistics are published for the previous day, while the main variable used as an early warning model must be at least two days ahead of time to have practical application [23]. As such, in the present study, we select the number of searches for Baidu index keywords related to the emergency state during the epidemic outbreak two days prior to the outbreak, as an input feature. This information is also gathered by web crawler technology on the official Baidu index web interface (https://index.baidu.com). The time period is from January 18, 2020, to May 5, 2020.


### 2.2. Data Preprocessing

As a keyword, it is a term that summarizes what the user is seeking most concisely. The effectiveness of this prediction depends on selecting effective web search terms relevant to this COVID-19 outbreak. There are three primary types of initial keyword selection methods: direct word selection method, technical word selection method, and range word selection method [24]. The analysis of the advantages and disadvantages of these three types of initial keyword selection methods and the review of relevant literature have led this study to adopt range word selection in combination with the direct word selection method to select 42 keyword libraries. High-dimensional data often cause problems, such as high computational complexity and long running times for models, which is why this study employs the Lasso method to reduce the dimensionality of the initially established index system and eliminate the features of no significant significance. Basically, the Lasso method is to add a penalty function to the sum of squared residuals and compress the coefficients in estimating the parameters to produce feature selection: the larger the parameter λ, the fewer the features selected. Our paper utilized a 10-fold cross-validation method to determine the best value for λ. The seven keywords with zero coefficients were removed, and a total of 35 keywords were found as predictive factors across four categories of prevention, symptoms, treatment, and common COVID-19 terms, as shown in Table 1.Table 1
Web search keyword phrase database.
CategoryWeb search keywordsCommon wordsNew Coronavirus (X1), New Coronary Pneumonia (X2), Respiratory diseases (X3), COVID-19 (X4)PreventionN95 mask (X5), medical surgical mask (X6), nucleic acid detection (X7), epidemic prevention and control (X8), hand washing (X9), seven-step hand washing technique (X10), hand sanitizer (X11), hand sanitizer (X12), disinfection (X13), 84 disinfectant (X14), disinfectant brand (X15), chlorine dioxide (X16), thermometer (X17), forehead temperature gun (X18), infrared thermometer (X19)SymptomsFever (X20), malaise (X21), respiratory infection (X22), cold (X23), headache (X24), diarrhoea (X25), virus mutation (X26), asymptomatic infected person (X27), aerosol transmission (X28), contact transmission (X29), incubation period (X30)TreatmentFever clinic (X31), cold medicine (X32), fever-reducing medicine (X33), new crown vaccine (X34), ventilator (X35)The web search keywords in the table were used as input features, and the national cumulative number of confirmed diagnoses was used as a predictor label. Also, all prediction data have been normalized to eliminate prediction errors caused by different data magnitudes. Normalization is determined by the following mathematical principle:(1)x∗=x−xminxmax−xmin.Here,x∗ is the normalized data value, x is the original data value before normalization, and xmin and xmax are the minimum and maximum values of the original data. This normalized value falls within the range of [0, 1], which is then randomly divided into a training set and a test set (where the training set represents 80% of the data samples and the test set represents 20%), and once the model has been trained, the prediction results are back-normalized to obtain the predicted values.


### 2.3. Correlation Analysis of Sample Data

Spearman’s correlation coefficients were calculated between the final keyword data in Table1 and the predicted variable (cumulative number of confirmed diagnoses). The results are shown in Table 2. It can be seen that the Baidu index of 33 of the 35 keywords selected in the sample data showed a statistically significant correlation with the cumulative number of confirmed cases of COVID-19 (P<0.01). Among them, the correlations of “fever,” “malaise,” “respiratory infection,” and “cold” were high in the classification of symptom words, with absolute values above 0.8. Although these four symptoms are not specific to COVID-19, they are easy to identify and are of great concern to the general population and are the best indicators of possible COVID-19 infection. It also indicates that the general population is aware of the basic knowledge of the symptoms of COVID-19. In addition, the absolute values of the correlation coefficients of “N95 mask,” “medical surgical mask,” and “84 disinfectant” also reached above 0.8. It indicates that with the further spread of the epidemic and the escalation of prevention and control measures, residents’ demand for personal protection knowledge tends to be stronger.Table 2
Correlation analysis of predictor and predicted variables in sample data.
Predicted variable: cumulative number of confirmed cases in ChinaPredictor variableCorrelation coefficientP valuePredictor variableCorrelation coefficientP valueX10.034＞0.05X20.139>0.05X3−0.592<0.01X40.538<0.01X5−0.929<0.01X6−0.874<0.01X70.536<0.01X8−0.366<0.01X9−0.591<0.01X100.485<0.01X11−0.564<0.01X12−0.536<0.01X13−0.762<0.01X14−0.815<0.01X15−0.724<0.01X16−0.574<0.01X17−0.789<0.01X18−0.353<0.01X19−0.651<0.01X20−0.820<0.01X21−0.825<0.01X22−0.969<0.01X23−0.956<0.01X24−0.726<0.01X25−0.727<0.01X26−0.583<0.01X270.692<0.01X28−0.216<0.01X29−0.474<0.01X30−0.727<0.01X31−0.882<0.01X32−0.917<0.01X33−0.915<0.01X340.715<0.01X350.596<0.01


## 2.1. Data Collection

We used the cumulative number of confirmed diagnoses nationwide as the prediction label here, which was obtained using the DXY website’s (https://www.dxy.cn) interface (excluding Hong Kong, Macau, and Taiwan). Data began with the first national notification on the official website of the National Health and Wellness Commission of the People’s Republic of China. As of January 20, 2020, to May 7, 2020, the period ranged from the time the national prevention and control work was mostly in the normalization stage [21], with a total of 110 valid observations.The internet generates more data with greater timeliness with the development of information technology and the penetration of networks. During an outbreak, people will turn to search engines, such as Baidu and Google, to seek information about the outbreak’s cause and the corresponding preventive measures. Utilizing open-source web search data to monitor the new corona epidemic in China is a powerful addition to traditional surveillance tools and can serve as an early warning system, guide medical treatment, and improve prevention and control strategies during the incipient stages of the epidemic. China’s most frequently used search engine Baidu has a feature called Baidu search index that counts the daily search volume figures for various keywords. It can effectively reflect a keyword’s media and user attention at a specific point in time and reflect the network public opinion change in an emergency situation [22]. According to the Baidu index, daily statistics are published for the previous day, while the main variable used as an early warning model must be at least two days ahead of time to have practical application [23]. As such, in the present study, we select the number of searches for Baidu index keywords related to the emergency state during the epidemic outbreak two days prior to the outbreak, as an input feature. This information is also gathered by web crawler technology on the official Baidu index web interface (https://index.baidu.com). The time period is from January 18, 2020, to May 5, 2020.


## 2.2. Data Preprocessing

As a keyword, it is a term that summarizes what the user is seeking most concisely. The effectiveness of this prediction depends on selecting effective web search terms relevant to this COVID-19 outbreak. There are three primary types of initial keyword selection methods: direct word selection method, technical word selection method, and range word selection method [24]. The analysis of the advantages and disadvantages of these three types of initial keyword selection methods and the review of relevant literature have led this study to adopt range word selection in combination with the direct word selection method to select 42 keyword libraries. High-dimensional data often cause problems, such as high computational complexity and long running times for models, which is why this study employs the Lasso method to reduce the dimensionality of the initially established index system and eliminate the features of no significant significance. Basically, the Lasso method is to add a penalty function to the sum of squared residuals and compress the coefficients in estimating the parameters to produce feature selection: the larger the parameter λ, the fewer the features selected. Our paper utilized a 10-fold cross-validation method to determine the best value for λ. The seven keywords with zero coefficients were removed, and a total of 35 keywords were found as predictive factors across four categories of prevention, symptoms, treatment, and common COVID-19 terms, as shown in Table 1.Table 1
Web search keyword phrase database.
CategoryWeb search keywordsCommon wordsNew Coronavirus (X1), New Coronary Pneumonia (X2), Respiratory diseases (X3), COVID-19 (X4)PreventionN95 mask (X5), medical surgical mask (X6), nucleic acid detection (X7), epidemic prevention and control (X8), hand washing (X9), seven-step hand washing technique (X10), hand sanitizer (X11), hand sanitizer (X12), disinfection (X13), 84 disinfectant (X14), disinfectant brand (X15), chlorine dioxide (X16), thermometer (X17), forehead temperature gun (X18), infrared thermometer (X19)SymptomsFever (X20), malaise (X21), respiratory infection (X22), cold (X23), headache (X24), diarrhoea (X25), virus mutation (X26), asymptomatic infected person (X27), aerosol transmission (X28), contact transmission (X29), incubation period (X30)TreatmentFever clinic (X31), cold medicine (X32), fever-reducing medicine (X33), new crown vaccine (X34), ventilator (X35)The web search keywords in the table were used as input features, and the national cumulative number of confirmed diagnoses was used as a predictor label. Also, all prediction data have been normalized to eliminate prediction errors caused by different data magnitudes. Normalization is determined by the following mathematical principle:(1)x∗=x−xminxmax−xmin.Here,x∗ is the normalized data value, x is the original data value before normalization, and xmin and xmax are the minimum and maximum values of the original data. This normalized value falls within the range of [0, 1], which is then randomly divided into a training set and a test set (where the training set represents 80% of the data samples and the test set represents 20%), and once the model has been trained, the prediction results are back-normalized to obtain the predicted values.


## 2.3. Correlation Analysis of Sample Data

Spearman’s correlation coefficients were calculated between the final keyword data in Table1 and the predicted variable (cumulative number of confirmed diagnoses). The results are shown in Table 2. It can be seen that the Baidu index of 33 of the 35 keywords selected in the sample data showed a statistically significant correlation with the cumulative number of confirmed cases of COVID-19 (P<0.01). Among them, the correlations of “fever,” “malaise,” “respiratory infection,” and “cold” were high in the classification of symptom words, with absolute values above 0.8. Although these four symptoms are not specific to COVID-19, they are easy to identify and are of great concern to the general population and are the best indicators of possible COVID-19 infection. It also indicates that the general population is aware of the basic knowledge of the symptoms of COVID-19. In addition, the absolute values of the correlation coefficients of “N95 mask,” “medical surgical mask,” and “84 disinfectant” also reached above 0.8. It indicates that with the further spread of the epidemic and the escalation of prevention and control measures, residents’ demand for personal protection knowledge tends to be stronger.Table 2
Correlation analysis of predictor and predicted variables in sample data.
Predicted variable: cumulative number of confirmed cases in ChinaPredictor variableCorrelation coefficientP valuePredictor variableCorrelation coefficientP valueX10.034＞0.05X20.139>0.05X3−0.592<0.01X40.538<0.01X5−0.929<0.01X6−0.874<0.01X70.536<0.01X8−0.366<0.01X9−0.591<0.01X100.485<0.01X11−0.564<0.01X12−0.536<0.01X13−0.762<0.01X14−0.815<0.01X15−0.724<0.01X16−0.574<0.01X17−0.789<0.01X18−0.353<0.01X19−0.651<0.01X20−0.820<0.01X21−0.825<0.01X22−0.969<0.01X23−0.956<0.01X24−0.726<0.01X25−0.727<0.01X26−0.583<0.01X270.692<0.01X28−0.216<0.01X29−0.474<0.01X30−0.727<0.01X31−0.882<0.01X32−0.917<0.01X33−0.915<0.01X340.715<0.01X350.596<0.01


## 3. Algorithm Analysis

### 3.1. Grey Wolf Optimizer

Mirjalili et al. [25] developed a pack intelligence optimization algorithm in 2014 that emulates the predatory behavior of grey wolf packs by simulating behaviors characteristic of grey wolf packs. During the optimization phase of GWO, α, β, and δ wolves, the highest social level of the population in each generation, led the bottom ω wolves through encirclements and searching. GWO has a simple structure, few parameters to be adjusted, and is thus easily implemented, which makes it applicable to several fields. It has been widely used for optimization.To begin, we can describe mathematically the process by which a wolf pack searches for and slowly surrounds its prey.(2)D=C⋅Xpt−Xt,(3)Xt+1=Xpt−A⋅D,(4)a=2−2IM,(5)A=2a⋅r1−a,(6)C=2⋅r2.Here,Xt is the position of the prey after the tth iteration, Xpt is the position of the grey wolf at the tth iteration, D denotes the distance between the grey wolf and the prey, Xt+1 denotes the update of the position of the grey wolf, A and C are the coefficient vectors, a is the convergence factor whose value decreases linearly from 2 to 0 with the number of iterations, I is the number of previous iterations, and M is the maximum number of iterations. r1 and r2 are the random numbers between [0, 1].Secondly, the position of the three optimal wolvesα, β, and δ is constantly updated to determine the prey. The following is a mathematical description of the hunting process of a wolf pack:(7)Da=C1⋅Xαt−Xt,(8)Dβ=C2⋅Xβt−Xt,(9)Dδ=C3⋅Xδt−Xt,(10)X1t+1=Xαt−A1⋅Dα,(11)X2t+1=Xβt−A2⋅Dβ,(12)X3t+1=Xδt−A3⋅Dδ,(13)Xt+1=X1t+1+X2t+1+X3t+13.Here,Xαt, Xβt, and Xδt are the positions of α, β, and δ wolves when the population is iterated to the tth generation. Xt is the position of individual grey wolves in the tth generation. A1 and C1, A2 and C2, A3 and C3 are the coefficient vectors of α, β, and δ wolves, respectively. X1t+1, X2t+1, and X3t+1 indicate the positions of α, β, and δ wolves after t+1 iterations, respectively. Xt+1 is the position of the next generation of grey wolves.


### 3.2. Improving Grey Wolf Optimizer

Though the standard GWO provides better performance than most intelligent optimization methods, it is not suitable for dealing with complex functions. Hence, there is a need to improve the balance between global search and local convergence to improve the performance of the grey wolf algorithm [26]. In the standard GWO, the prey direction and distance between preys are continuously adjusted by employing the equations from (7) through (13) until the prey is caught after many iterations, and by analyzing this process, it was found that grey wolves move to the same region as the number of iterations increases, which makes the whole pack converge seriously, making the wolf pack easily fall into local optimum. The chaos opposition learning grey wolf optimizer (COLGWO) is proposed in this study as a method to enhance the defects of standard GWO. The details are provided below.


#### 3.2.1. Opposition-Based Learning

If the grey wolves of the initialized population are near the optimal solution, the convergence is quicker, and if the grey wolves of the initialized population deviate from the optimal solution, the algorithm is slower or fails to converge. Opposition-based learning (OBL) was implemented by Tizhoosh et al. [27] to help expand the individual search space, enhance the global exploration capability, and overcome the algorithm falling into local optimum. Below is its mathematical definition.Initially, setting the inverse point serves as the population initialization for the grey wolf optimizer. For a pointx=x1,x2,…,xD in the D-dimensional space, its reverse point x˜=x˜1,x˜2,…,x˜D is calculated as follows:(14)x˜i=ai+bi−xi.Here,xi∈ai,bi, and ai and bi are the value boundaries of the point x in the ith dimension.Secondly, the grey wolf algorithm is iteratively optimized using backward learning and jump probabilities to best achieve its global optimization objectives. LetJr be the jump probability, and if rand0,1≤Jr, then the reverse learning population is generated. Setting as one of the grey wolf individuals in the Dth dimension, x⟶i=xi,1,xi,2,…,xi,D,xi,j∈aj,bj, the corresponding inverse solution x˜i=xi,1,xi,2,…,xi,D for that individual is calculated as follows:(15)x˜i,j=k⋅daj+dbj−xi,j.Here,k takes the value of any random number between [0, 1], and [daj, dbj] is the dynamic boundary of the particle in the Jth dimension, which is calculated as follows:(16)daj=minxi,j,dbj=maxxi,j.Within the dynamic boundary, a point is generated at random if the reverse solution jumps out of it.(17)x˜i,j=randdaj,dbj,ifx˜i,j<dajorx˜i,j>dbj.


#### 3.2.2. Chaotic Search Factor

By utilizing the randomness, ergodicity, and regularity of the logistic chaotic sequence, a chaotic search input is added to the grey wolf optimizer, and a local search is performed in the vicinity of the optimalα-wolf in each iteration. In addition, a shrinkage strategy is introduced to achieve a large search range at the beginning of the iteration and a smaller search range at the end, which enhances the local mining capability of the standard GWO algorithm, allowing the algorithm to perform both global and local searches equally well while improving its accuracy. The following is a mathematical description.The first step is to generate the chaotic variablesci.(18)ci+1=4⋅ci⋅1−ci.Here, the range of the values ofi is [1, K], the range of the values of ci is (0, 1), and ci ≠ 0.25, 0.5, and 0.75. K is the length of the chaotic sequence.A second step is the mapping of the chaotic variableci generated by equation (18) to a chaotic vector Ci in the definition domain [LB, UB].(19)Ci=LB+ci⋅UB−LB.Here,i takes values within the range [1, K]. LB and UB represent the lower and upper limits, respectively.In addition, the chaotic vectorCi and optimal α-wolf are linearly combined to generate the chaotic wolf Vi.(20)Vi=1−λ⋅α+λ⋅Ci,(21)λ=M−I+1M.where i belongs to the range [1, K]. λ is the contraction factor, M is the maximum number of iterations in the algorithm, and I is the current number of iterations.To be able to better understand the chaos search factor, the following is a brief example of a one-dimensional function sphere, from which higher dimensions can be extended. Suppose the function is defined in the domain [−100, 100], the current optimalα wolf is 10, the current iteration number is 2, and the maximum iteration number is 100. If the random number c1=0.1, then according to equation (18), we have c2=0.36 and c3=0.9216. In turn, according to equation (19), we have C1=−80, C2=−28, and C3=84.32. From equation (21), we can get λ=0.99 at this time. Then, the chaos vector Ci is linearly combined with the head wolf α at this time by equation (20) to get the chaos wolf V1=−79.1, V2=−27.62, and V3=83.5768. However, if the generated Vi fitness value is better than that of the α wolf, then the new α wolf is replaced as Vi. It should be noted that if the current iteration number is 1, then λ=1 and Vi=Ci, i.e., V1=80, V2=−28, and V3=84.32. The chaotic wolves at this point are randomly generated from the chaotic vectors, independent of the head wolf. It can be observed from the above example that λ gradually becomes smaller with the increase of evolutionary generations, and the generated chaotic wolf is smaller at this time, which indicates that the scope of local search becomes smaller with the continuous iteration of the grey wolf optimizer.


### 3.3. Bagging-Integrated Learning Strategy

For integrated learning methods to improve model generalization and prediction accuracy, a combination of prediction results from multiple homogeneous or heterogeneous models is often used [28]. Bootstrap aggregating (Bagging) aims to combine the predictions of multiple homogeneous base learners, and the combination of this strategy can achieve a significant improvement in prediction model generalization capabilities and avoid the phenomenon of overfitting.In Bagging-integrated learning strategy, data are randomly selected from a data set using a put-back sampling methodology (Bootstrap) and thenN subtraining sets of equal size are produced. Following that, each subtraining set is separately trained to obtain N base learners, and finally, the final prediction results of each base learner are arithmetically averaged together. This process is illustrated in Figure 1.Figure 1
Bagging integration model.


### 3.4. Bagging-COLGWO-XGBoost Model

XGBsoost is a boosting class model that has been developed by Chen et al. [29] in 2016, which is a combination of a linear scale solver and a categorical regression tree. The basic idea behind this model is to combine multiple tree models that have low prediction accuracy through various methodologies to construct a combined model with a higher prediction accuracy. After the combinatorial model is constructed, it is iterated through gradient boosting, with each iteration producing a new tree to fit the residuals generated by the previous tree until the optimal model is obtained. The XGBoost method is based upon a second-order Taylor expansion of the loss function. Furthermore, to mitigate the decline of the objective function and the complexity of the model, a regular term is added in addition to the objective function to arrive at the optimal solution, thereby avoiding the overfitting problem. A number of studies in recent years have demonstrated good performance of the XGBoost model for predictions in biology, medicine, and economics. The mathematical principles of the model are as follows:The integration model of the definition tree is as follows:(22)yi^=∑m=1Mfmxi,fm∈F.In this equation,yi^ is the prediction value, M is the number of trees, F is the range of tree selections, and xi is the ith input feature.The loss function for the XGBoost model is shown below.(23)L=∑i=1nlyi,yi^+∑m=1Mθfm.Here, the first part of the function is the error between the predicted and the actual training values of the XGBoost model, while the second is used to represent the complexity of the tree, which is important when controlling the regularization of the complexity of the model.(24)θf=γT+12τω2.Here,γ and τ represent penalty factors.It is minimized by adding the incremental functionftxi to equation (23) to minimize the value of the loss function. Thus, the objective function for the tth time becomes as follows:(25)Lt=∑i=1nlyi,yi^+∑m=1Mθfm=∑i=1nlyi,yi^t−1+ftxi+θft.A second-order Taylor expansion of equation (25) is used to approximate the objective function at this point. Define the set of samples in each subleaf of the jth tree as Ij=i|qxi=j. At this point, we can approximate Lt as follows:(26)Lt≅∑i=1ngiftxi+12hift2xi+θft≅∑i=1ngiftxi+12hift2xi+γT+12τω2≅∑j=1T∑i∈Ijgiωj+12∑i∈Ijhi+τωj2+γT.Here,gi=∂yi^t−1lyi,yi^t−1 is the first-order derivative of the loss function. hi=∂yi^t−12lyi,yi^t−1 is the second-order derivative. The subsequent equation is calculated by defining Gj=∑i∈Ijgi, Hj=∑i∈Ijhi.(27)Lt≅∑j=1TGjωj+12Hj+τωj2+γT.The following equation is obtained by taking the partial derivatives ofω.(28)ωj=−GjHj+τ.The following equation can be obtained by substituting the weights into the objective function.(29)Lt≅−12∑j=1TGj2Hj+τ+γT.Training the XGBoost model is heavily dependent on the choice of parameters as different parameter selections have a significant effect on the prediction results. Within the XGBoost algorithm, there are 23 hyperparameters, which can be classified into three types: general parameters for the control of macrofunctions, booster parameters to control booster details, and learning target parameters to control the training target parameters. COLGWO-XGBoost takes the three hyperparameters oflearning_rate, n_estimators, and max_depth, which have the greatest impact on the performance of XGBoost, and uses them in the calculation of the position vector of the head wolf α in COLGWO. The COLGWO algorithm is iterated until the position vector corresponding to the global optimal position is returned to the XGBoost model. Furthermore, to enhance the generalization characteristics of the prediction model, the Bagging integration strategy is employed to directly integrate the COLGWO-XGBoost model into the integrated learning process to construct the final early warning model in this paper. The combined use of this strategy can reduce the variance of the COLGWO-XGBoost model and prevent overfitting. The following are specific steps for implementing the model.Step 1.
Initialize the parameters by setting the maximum number of iterationsM, the number of populations N, the upper bound UB, and the lower bound LB of the parameters to be searched for COLGWO.Step 2.
Randomly initialize the populations and generate equal numbers of reverse populations based on equation (14), use equation (29), select the individual positions that correspond to the optimal fitness values among the two populations to be put into the final initial population, and then select the individual positions that correspond to the optimal three fitness values as α, β, and δ wolves.Step 3.
The chaotic search factor is called to generate the chaotic wolfVi according to equations 18 through (21), and if the fitness value of Vi is greater than α wolf, then Vi is replaced with α wolf, and the local search ends. Otherwise, if the chaotic sequence length is K, then the local search ends as well.Step 4.
The convergence coefficienta and the coefficient vectors A and C were updated for α, β, and δ wolves, respectively, according to equations (4) to (6).Step 5.
It is necessary to calculate the distances betweenα, β, and δ wolves and their prey, and update the positions of these wolves according to equations (7) to (12), respectively.Step 6.
Update wolf locations based on equation (13) to produce a new generation of grey wolf populations.Step 7.
Follow Steps3 to 6. If the maximum number of COLGWO iterations M is reached, then stop the iteration. Determine the position of α wolf at this point as a parameter of the sought-after XGBoost model, and construct the COLGWO-XGBoost prediction model.Step 8.
Using bootstrap sampling, input data are divided intoN subtraining sets of equal sample size, and then the COLGWO-XGBoost model is used to fit each subtraining set separately to generate N base learners.Step 9.
UsingN base learners, the prediction data are predicted separately, and their predicted results are arithmetically averaged, resulting in the final prediction result of the Bagging-COLGWO-XGBoost model.


## 3.1. Grey Wolf Optimizer

Mirjalili et al. [25] developed a pack intelligence optimization algorithm in 2014 that emulates the predatory behavior of grey wolf packs by simulating behaviors characteristic of grey wolf packs. During the optimization phase of GWO, α, β, and δ wolves, the highest social level of the population in each generation, led the bottom ω wolves through encirclements and searching. GWO has a simple structure, few parameters to be adjusted, and is thus easily implemented, which makes it applicable to several fields. It has been widely used for optimization.To begin, we can describe mathematically the process by which a wolf pack searches for and slowly surrounds its prey.(2)D=C⋅Xpt−Xt,(3)Xt+1=Xpt−A⋅D,(4)a=2−2IM,(5)A=2a⋅r1−a,(6)C=2⋅r2.Here,Xt is the position of the prey after the tth iteration, Xpt is the position of the grey wolf at the tth iteration, D denotes the distance between the grey wolf and the prey, Xt+1 denotes the update of the position of the grey wolf, A and C are the coefficient vectors, a is the convergence factor whose value decreases linearly from 2 to 0 with the number of iterations, I is the number of previous iterations, and M is the maximum number of iterations. r1 and r2 are the random numbers between [0, 1].Secondly, the position of the three optimal wolvesα, β, and δ is constantly updated to determine the prey. The following is a mathematical description of the hunting process of a wolf pack:(7)Da=C1⋅Xαt−Xt,(8)Dβ=C2⋅Xβt−Xt,(9)Dδ=C3⋅Xδt−Xt,(10)X1t+1=Xαt−A1⋅Dα,(11)X2t+1=Xβt−A2⋅Dβ,(12)X3t+1=Xδt−A3⋅Dδ,(13)Xt+1=X1t+1+X2t+1+X3t+13.Here,Xαt, Xβt, and Xδt are the positions of α, β, and δ wolves when the population is iterated to the tth generation. Xt is the position of individual grey wolves in the tth generation. A1 and C1, A2 and C2, A3 and C3 are the coefficient vectors of α, β, and δ wolves, respectively. X1t+1, X2t+1, and X3t+1 indicate the positions of α, β, and δ wolves after t+1 iterations, respectively. Xt+1 is the position of the next generation of grey wolves.


## 3.2. Improving Grey Wolf Optimizer

Though the standard GWO provides better performance than most intelligent optimization methods, it is not suitable for dealing with complex functions. Hence, there is a need to improve the balance between global search and local convergence to improve the performance of the grey wolf algorithm [26]. In the standard GWO, the prey direction and distance between preys are continuously adjusted by employing the equations from (7) through (13) until the prey is caught after many iterations, and by analyzing this process, it was found that grey wolves move to the same region as the number of iterations increases, which makes the whole pack converge seriously, making the wolf pack easily fall into local optimum. The chaos opposition learning grey wolf optimizer (COLGWO) is proposed in this study as a method to enhance the defects of standard GWO. The details are provided below.


### 3.2.1. Opposition-Based Learning

If the grey wolves of the initialized population are near the optimal solution, the convergence is quicker, and if the grey wolves of the initialized population deviate from the optimal solution, the algorithm is slower or fails to converge. Opposition-based learning (OBL) was implemented by Tizhoosh et al. [27] to help expand the individual search space, enhance the global exploration capability, and overcome the algorithm falling into local optimum. Below is its mathematical definition.Initially, setting the inverse point serves as the population initialization for the grey wolf optimizer. For a pointx=x1,x2,…,xD in the D-dimensional space, its reverse point x˜=x˜1,x˜2,…,x˜D is calculated as follows:(14)x˜i=ai+bi−xi.Here,xi∈ai,bi, and ai and bi are the value boundaries of the point x in the ith dimension.Secondly, the grey wolf algorithm is iteratively optimized using backward learning and jump probabilities to best achieve its global optimization objectives. LetJr be the jump probability, and if rand0,1≤Jr, then the reverse learning population is generated. Setting as one of the grey wolf individuals in the Dth dimension, x⟶i=xi,1,xi,2,…,xi,D,xi,j∈aj,bj, the corresponding inverse solution x˜i=xi,1,xi,2,…,xi,D for that individual is calculated as follows:(15)x˜i,j=k⋅daj+dbj−xi,j.Here,k takes the value of any random number between [0, 1], and [daj, dbj] is the dynamic boundary of the particle in the Jth dimension, which is calculated as follows:(16)daj=minxi,j,dbj=maxxi,j.Within the dynamic boundary, a point is generated at random if the reverse solution jumps out of it.(17)x˜i,j=randdaj,dbj,ifx˜i,j<dajorx˜i,j>dbj.


### 3.2.2. Chaotic Search Factor

By utilizing the randomness, ergodicity, and regularity of the logistic chaotic sequence, a chaotic search input is added to the grey wolf optimizer, and a local search is performed in the vicinity of the optimalα-wolf in each iteration. In addition, a shrinkage strategy is introduced to achieve a large search range at the beginning of the iteration and a smaller search range at the end, which enhances the local mining capability of the standard GWO algorithm, allowing the algorithm to perform both global and local searches equally well while improving its accuracy. The following is a mathematical description.The first step is to generate the chaotic variablesci.(18)ci+1=4⋅ci⋅1−ci.Here, the range of the values ofi is [1, K], the range of the values of ci is (0, 1), and ci ≠ 0.25, 0.5, and 0.75. K is the length of the chaotic sequence.A second step is the mapping of the chaotic variableci generated by equation (18) to a chaotic vector Ci in the definition domain [LB, UB].(19)Ci=LB+ci⋅UB−LB.Here,i takes values within the range [1, K]. LB and UB represent the lower and upper limits, respectively.In addition, the chaotic vectorCi and optimal α-wolf are linearly combined to generate the chaotic wolf Vi.(20)Vi=1−λ⋅α+λ⋅Ci,(21)λ=M−I+1M.where i belongs to the range [1, K]. λ is the contraction factor, M is the maximum number of iterations in the algorithm, and I is the current number of iterations.To be able to better understand the chaos search factor, the following is a brief example of a one-dimensional function sphere, from which higher dimensions can be extended. Suppose the function is defined in the domain [−100, 100], the current optimalα wolf is 10, the current iteration number is 2, and the maximum iteration number is 100. If the random number c1=0.1, then according to equation (18), we have c2=0.36 and c3=0.9216. In turn, according to equation (19), we have C1=−80, C2=−28, and C3=84.32. From equation (21), we can get λ=0.99 at this time. Then, the chaos vector Ci is linearly combined with the head wolf α at this time by equation (20) to get the chaos wolf V1=−79.1, V2=−27.62, and V3=83.5768. However, if the generated Vi fitness value is better than that of the α wolf, then the new α wolf is replaced as Vi. It should be noted that if the current iteration number is 1, then λ=1 and Vi=Ci, i.e., V1=80, V2=−28, and V3=84.32. The chaotic wolves at this point are randomly generated from the chaotic vectors, independent of the head wolf. It can be observed from the above example that λ gradually becomes smaller with the increase of evolutionary generations, and the generated chaotic wolf is smaller at this time, which indicates that the scope of local search becomes smaller with the continuous iteration of the grey wolf optimizer.


## 3.2.1. Opposition-Based Learning

If the grey wolves of the initialized population are near the optimal solution, the convergence is quicker, and if the grey wolves of the initialized population deviate from the optimal solution, the algorithm is slower or fails to converge. Opposition-based learning (OBL) was implemented by Tizhoosh et al. [27] to help expand the individual search space, enhance the global exploration capability, and overcome the algorithm falling into local optimum. Below is its mathematical definition.Initially, setting the inverse point serves as the population initialization for the grey wolf optimizer. For a pointx=x1,x2,…,xD in the D-dimensional space, its reverse point x˜=x˜1,x˜2,…,x˜D is calculated as follows:(14)x˜i=ai+bi−xi.Here,xi∈ai,bi, and ai and bi are the value boundaries of the point x in the ith dimension.Secondly, the grey wolf algorithm is iteratively optimized using backward learning and jump probabilities to best achieve its global optimization objectives. LetJr be the jump probability, and if rand0,1≤Jr, then the reverse learning population is generated. Setting as one of the grey wolf individuals in the Dth dimension, x⟶i=xi,1,xi,2,…,xi,D,xi,j∈aj,bj, the corresponding inverse solution x˜i=xi,1,xi,2,…,xi,D for that individual is calculated as follows:(15)x˜i,j=k⋅daj+dbj−xi,j.Here,k takes the value of any random number between [0, 1], and [daj, dbj] is the dynamic boundary of the particle in the Jth dimension, which is calculated as follows:(16)daj=minxi,j,dbj=maxxi,j.Within the dynamic boundary, a point is generated at random if the reverse solution jumps out of it.(17)x˜i,j=randdaj,dbj,ifx˜i,j<dajorx˜i,j>dbj.


## 3.2.2. Chaotic Search Factor

By utilizing the randomness, ergodicity, and regularity of the logistic chaotic sequence, a chaotic search input is added to the grey wolf optimizer, and a local search is performed in the vicinity of the optimalα-wolf in each iteration. In addition, a shrinkage strategy is introduced to achieve a large search range at the beginning of the iteration and a smaller search range at the end, which enhances the local mining capability of the standard GWO algorithm, allowing the algorithm to perform both global and local searches equally well while improving its accuracy. The following is a mathematical description.The first step is to generate the chaotic variablesci.(18)ci+1=4⋅ci⋅1−ci.Here, the range of the values ofi is [1, K], the range of the values of ci is (0, 1), and ci ≠ 0.25, 0.5, and 0.75. K is the length of the chaotic sequence.A second step is the mapping of the chaotic variableci generated by equation (18) to a chaotic vector Ci in the definition domain [LB, UB].(19)Ci=LB+ci⋅UB−LB.Here,i takes values within the range [1, K]. LB and UB represent the lower and upper limits, respectively.In addition, the chaotic vectorCi and optimal α-wolf are linearly combined to generate the chaotic wolf Vi.(20)Vi=1−λ⋅α+λ⋅Ci,(21)λ=M−I+1M.where i belongs to the range [1, K]. λ is the contraction factor, M is the maximum number of iterations in the algorithm, and I is the current number of iterations.To be able to better understand the chaos search factor, the following is a brief example of a one-dimensional function sphere, from which higher dimensions can be extended. Suppose the function is defined in the domain [−100, 100], the current optimalα wolf is 10, the current iteration number is 2, and the maximum iteration number is 100. If the random number c1=0.1, then according to equation (18), we have c2=0.36 and c3=0.9216. In turn, according to equation (19), we have C1=−80, C2=−28, and C3=84.32. From equation (21), we can get λ=0.99 at this time. Then, the chaos vector Ci is linearly combined with the head wolf α at this time by equation (20) to get the chaos wolf V1=−79.1, V2=−27.62, and V3=83.5768. However, if the generated Vi fitness value is better than that of the α wolf, then the new α wolf is replaced as Vi. It should be noted that if the current iteration number is 1, then λ=1 and Vi=Ci, i.e., V1=80, V2=−28, and V3=84.32. The chaotic wolves at this point are randomly generated from the chaotic vectors, independent of the head wolf. It can be observed from the above example that λ gradually becomes smaller with the increase of evolutionary generations, and the generated chaotic wolf is smaller at this time, which indicates that the scope of local search becomes smaller with the continuous iteration of the grey wolf optimizer.


## 3.3. Bagging-Integrated Learning Strategy

For integrated learning methods to improve model generalization and prediction accuracy, a combination of prediction results from multiple homogeneous or heterogeneous models is often used [28]. Bootstrap aggregating (Bagging) aims to combine the predictions of multiple homogeneous base learners, and the combination of this strategy can achieve a significant improvement in prediction model generalization capabilities and avoid the phenomenon of overfitting.In Bagging-integrated learning strategy, data are randomly selected from a data set using a put-back sampling methodology (Bootstrap) and thenN subtraining sets of equal size are produced. Following that, each subtraining set is separately trained to obtain N base learners, and finally, the final prediction results of each base learner are arithmetically averaged together. This process is illustrated in Figure 1.Figure 1
Bagging integration model.


## 3.4. Bagging-COLGWO-XGBoost Model

XGBsoost is a boosting class model that has been developed by Chen et al. [29] in 2016, which is a combination of a linear scale solver and a categorical regression tree. The basic idea behind this model is to combine multiple tree models that have low prediction accuracy through various methodologies to construct a combined model with a higher prediction accuracy. After the combinatorial model is constructed, it is iterated through gradient boosting, with each iteration producing a new tree to fit the residuals generated by the previous tree until the optimal model is obtained. The XGBoost method is based upon a second-order Taylor expansion of the loss function. Furthermore, to mitigate the decline of the objective function and the complexity of the model, a regular term is added in addition to the objective function to arrive at the optimal solution, thereby avoiding the overfitting problem. A number of studies in recent years have demonstrated good performance of the XGBoost model for predictions in biology, medicine, and economics. The mathematical principles of the model are as follows:The integration model of the definition tree is as follows:(22)yi^=∑m=1Mfmxi,fm∈F.In this equation,yi^ is the prediction value, M is the number of trees, F is the range of tree selections, and xi is the ith input feature.The loss function for the XGBoost model is shown below.(23)L=∑i=1nlyi,yi^+∑m=1Mθfm.Here, the first part of the function is the error between the predicted and the actual training values of the XGBoost model, while the second is used to represent the complexity of the tree, which is important when controlling the regularization of the complexity of the model.(24)θf=γT+12τω2.Here,γ and τ represent penalty factors.It is minimized by adding the incremental functionftxi to equation (23) to minimize the value of the loss function. Thus, the objective function for the tth time becomes as follows:(25)Lt=∑i=1nlyi,yi^+∑m=1Mθfm=∑i=1nlyi,yi^t−1+ftxi+θft.A second-order Taylor expansion of equation (25) is used to approximate the objective function at this point. Define the set of samples in each subleaf of the jth tree as Ij=i|qxi=j. At this point, we can approximate Lt as follows:(26)Lt≅∑i=1ngiftxi+12hift2xi+θft≅∑i=1ngiftxi+12hift2xi+γT+12τω2≅∑j=1T∑i∈Ijgiωj+12∑i∈Ijhi+τωj2+γT.Here,gi=∂yi^t−1lyi,yi^t−1 is the first-order derivative of the loss function. hi=∂yi^t−12lyi,yi^t−1 is the second-order derivative. The subsequent equation is calculated by defining Gj=∑i∈Ijgi, Hj=∑i∈Ijhi.(27)Lt≅∑j=1TGjωj+12Hj+τωj2+γT.The following equation is obtained by taking the partial derivatives ofω.(28)ωj=−GjHj+τ.The following equation can be obtained by substituting the weights into the objective function.(29)Lt≅−12∑j=1TGj2Hj+τ+γT.Training the XGBoost model is heavily dependent on the choice of parameters as different parameter selections have a significant effect on the prediction results. Within the XGBoost algorithm, there are 23 hyperparameters, which can be classified into three types: general parameters for the control of macrofunctions, booster parameters to control booster details, and learning target parameters to control the training target parameters. COLGWO-XGBoost takes the three hyperparameters oflearning_rate, n_estimators, and max_depth, which have the greatest impact on the performance of XGBoost, and uses them in the calculation of the position vector of the head wolf α in COLGWO. The COLGWO algorithm is iterated until the position vector corresponding to the global optimal position is returned to the XGBoost model. Furthermore, to enhance the generalization characteristics of the prediction model, the Bagging integration strategy is employed to directly integrate the COLGWO-XGBoost model into the integrated learning process to construct the final early warning model in this paper. The combined use of this strategy can reduce the variance of the COLGWO-XGBoost model and prevent overfitting. The following are specific steps for implementing the model.Step 1.
Initialize the parameters by setting the maximum number of iterationsM, the number of populations N, the upper bound UB, and the lower bound LB of the parameters to be searched for COLGWO.Step 2.
Randomly initialize the populations and generate equal numbers of reverse populations based on equation (14), use equation (29), select the individual positions that correspond to the optimal fitness values among the two populations to be put into the final initial population, and then select the individual positions that correspond to the optimal three fitness values as α, β, and δ wolves.Step 3.
The chaotic search factor is called to generate the chaotic wolfVi according to equations 18 through (21), and if the fitness value of Vi is greater than α wolf, then Vi is replaced with α wolf, and the local search ends. Otherwise, if the chaotic sequence length is K, then the local search ends as well.Step 4.
The convergence coefficienta and the coefficient vectors A and C were updated for α, β, and δ wolves, respectively, according to equations (4) to (6).Step 5.
It is necessary to calculate the distances betweenα, β, and δ wolves and their prey, and update the positions of these wolves according to equations (7) to (12), respectively.Step 6.
Update wolf locations based on equation (13) to produce a new generation of grey wolf populations.Step 7.
Follow Steps3 to 6. If the maximum number of COLGWO iterations M is reached, then stop the iteration. Determine the position of α wolf at this point as a parameter of the sought-after XGBoost model, and construct the COLGWO-XGBoost prediction model.Step 8.
Using bootstrap sampling, input data are divided intoN subtraining sets of equal sample size, and then the COLGWO-XGBoost model is used to fit each subtraining set separately to generate N base learners.Step 9.
UsingN base learners, the prediction data are predicted separately, and their predicted results are arithmetically averaged, resulting in the final prediction result of the Bagging-COLGWO-XGBoost model.


## 4. Experimental Results and Discussion

### 4.1. Improved Algorithm Performance Testing

#### 4.1.1. Standard Test Functions

We have selected eight typical standard test functions from the global optimization benchmark functionality library to test the optimization-seeking capability of the COLGWO algorithm, whose names, functions, search intervals, and theoretical minimum values are shown in Table3. f1x∼f4x are continuous single-peaked functions, which are typically used to test the local mining abilities of algorithms. f5x∼f8x are complex nonlinear multipeaked functions with a large number of local extremes, which are generally used to test the global pioneering abilities of algorithms, and their results provide guidance to algorithms.Table 3
Brief information on the 8 standard test functions.
Function nameFunction formSearch intervalMinimum valuef1xDiscusf1x=106x12+∑i=2Dxi2−100,1000f2xBent Cigarf2x=x12+106∑i=2Dxi2−100,1000f3xZakharovf3x=∑i=1Dxi2+∑i=1D0.5xi2+∑i=1D0.5xi4−100,1000f4xSpheref4x=∑i=1Dxi2−100,1000f5xRastriginf5x=∑i=1Dxi2−10cos2πxi+10−100,1000f6xGriewankf6x=∑i=1Dxi2/4000−∏i=1Dcosxi/i+1−100,1000f7xRosenbrockf7x=∑i=1D−1100xi2−xi+12+xi−12−100,1000f8xAckleyf8x=−20exp−0.21/D∑i=1Dxi2−exp1/D∑i=1Dcos2πxi+20+e−100,1000


#### 4.1.2. Experimental Analysis

A comparison of the optimization performance of DE (differential evolution), PSO (particle swarm optimization), GWO, and COLGWO in eight typical benchmark test functions was conducted in the same runtime environment using Python version 3.7 as the simulation program. The primary parameters of the four algorithms were the same, namely 30 populations, a maximum number of iterations of 500, and a dimension of 30. The algorithms were run independently 30 times, and the mean and standard deviation of the search results were calculated. Table4 shows the experimental results. On the basis of Table 4, it can be observed that the optimization results of GWO outperform those of the two classical evolutionary algorithms, DE and PSO, for continuous single-peak functions and complex nonlinear multipeak functions. Even though the improved COLGWO algorithm does not achieve the theoretically optimal solution for the f8x function, it improves significantly compared to before the improvement, and it has the best solution accuracy among the four algorithms. It indicates that the modification of the standard GWO algorithm in this study is very effective, can well-balance the global search ability and local search ability, and improve the stability of the algorithm. For the eight standard test functions, Table 4 only displays the optimal values determined by the four algorithms. A comparison graph of the convergence of the four algorithms for the test functions is shown in Figure 2 for the purpose of visualizing the convergence of the algorithms. Based on Figure 2, the speed of convergence of COLGWO algorithm has been significantly accelerated. Because of this, the improved algorithm presented in this paper takes into account the convergence speed, global exploration ability, and local fine search ability of the algorithm at the same time, which is a very powerful improvement.Table 4
Optimization search results of four algorithms for standard test functions.
DEPSOGWOCOLGWOf1xAverage value0.007169528819623764.58E − 071.74E − 270Standard deviation0.008924343209060379.67E − 072.64E − 270f2xAverage value2459.11866144729 44831533444.98E − 220Standard deviation2438.7229420368315.266850179.28E − 220f3xAverage value0.2544996573124073.41E − 059.27E − 240Standard deviation0.6814256763075187.64E − 051.25E − 230f4xAverage value0.004406969619568761.15E − 076.60E − 280Standard deviation0.004890543235093371.96E − 078.25E − 280f5xAverage value211.3429011989911129.8809793.2168227960Standard deviation21.4117756082338421.97138174.9076232410f6xAverage value0.004071610547935630.0331675930.0034564940Standard deviation0.006369930452106430.0338204780.0075183880f7xAverage value34.99089558084770.0349191372.4857017320Standard deviation22.32833055762750.03595113312.084063810f8xAverage value20.980574001139120.478329349.9326191464.44E − 16Standard deviation0.1063985933675190.61818032510.411136010Figure 2
Algorithm adaptation evolution curve.


### 4.2. Comparison of Prediction Effects

#### 4.2.1. Evaluation Functions

As evaluation functions for the forecasting models, we select root mean squared error (RMSE), mean absolute error (MAE), and mean absolute percentage error (MAPE). The model’s smaller RMSE, MAE, and MAPE values indicate better prediction performance, and the actual formula is as follows:(30)RMSE=1n∑i=1nyi−yi^2,MAE=1n∑i=1nyi−yi^,MAPE=100%n∑i=1nyi−yi^yi.Here,n is the number of samples, i is the sample number, yi stands for the true value, and yi^ stands for the predicted value of the model.


#### 4.2.2. Experimental Analysis

The present study employs multiple algorithms as comparison models to evaluate the predictive ability of the Bagging-COLGWO-XGBoost model in the COVID-19 cumulative number of confirmations data. For single-model prediction, in addition to four traditional machine learning models of SVR, LR, MLP, and GDBT, convolutional neural networks (CNN) [30], recurrent neural network (RNN) [31], and long short-term memory (LSTM) [32], which are three classical deep learning models, were also selected to compare and analyze the prediction effect of XGBoost. In the combined algorithm prediction, the GWO-optimized XGBoost model (GWO-XGBoost), GWO-optimized GBDT model (GWO-GBDT), COLGWO-optimized GBDT (COLGWO-GBDT), COLGWO-optimized XGBoost (COLGWO-XGBoost), and Bagging-COLGWO-GBDT are selected to compare and analyze the prediction effects of the Bagging-COLGWO-XGBoost model proposed in this study. Table 5 contains the parameters of each algorithm model.Table 5
Algorithm-related parameters.
ModelParameter settingBagging-COLGWO-XGBoostn_estimators = 21Bagging-COLGWO-GBDTn_estimators = 21COLGWO-XGBoostn_estimators = 18; learning_rate = 0.8561; max_depth = 7COLGWO- GBDTn_estimators = 22; learning_rate = 0.3208; max_depth = 4GWO-XGBoostn_estimators = 46; learning_rate = 0.8563; max_depth = 6GWO-GBDTn_estimators = 38; learning_rate = 0.5996; max_depth = 4XGBoostDefault parameterGBDTDefault parameterLSTMOptimizer = Adam; loss = mse; epochs = 100RNNOptimizer = Adam; loss = mse; epochs = 100CNNOptimizer = Adam; loss = mse; epochs = 100SVRDefault parameterMLPDefault parameterLRDefault parameterCOLGWOIteration number: 100; Population size: 30GWOIteration number: 100; Population size: 30The main model and the comparison model proposed in this paper are fitted to each prediction model in the training dataset, and the predictions are performed on the test dataset. The prediction accuracy of the single model in the three indexes is given in Table6, and Figure 3 shows the prediction effect of the single model. It can be observed that the prediction performance of XGBoost and GBDT in single model is significantly better than SVR, MLP, LR, CNN, RNN, and LSTM. XGBoost ranked first in MAPE, and GBDT ranked first in RMSE and MAE. Both models outperformed several other comparative models in three metrics, RMSE, MAE, and MAPE, and this result indicates that the selection of a suitable regression model plays a key role in improving the prediction performance under the same data premise.Table 6
Single model prediction accuracy comparison.
Algorithm nameRMSEMAEMAPEXGBoost3965.7251469.4069.785GBDT3095.0051356.61910.753SVR8591.4447199.914223.206MLP8551.8566216.56686.296LR4683.8083406.161116.283LSTM4854.7583522.86712.967RNN6506.4144936.08232.877CNN5862.4564442.03927.082Bold font indicates the best prediction accuracy among all models.Figure 3
Single model prediction effect.To further observe the difference in prediction performance between GBDT and XGBoost, in the combined algorithm, the GWO-seeking algorithm is first proposed to optimize the hyperparameters of these two models separately, and then the COLGWO proposed in this paper is used to compare the optimization results. Finally, the Bagging strategy is used to integrate the learning of these two models. Table7 and Figure 4 show the experimental results of the combined algorithm. After using the GWO optimization algorithm, the prediction accuracy of GBDT is slightly improved, however, it significantly lags behind that of XGBoost, Using COLGWO for the parameter optimization of both models achieves better optimization results than GWO. Using the Bagging integration strategy can further reduce the generalization error of the combined algorithm, and this strategy has the best prediction effect when combined with XGBoost using COLGWO algorithm. It shows that the improvement of XGBoost on GBDT is successful. Since the model adds a regular term in the loss function for controlling the complexity of the model, it reduces the variance of the model in terms of the trade-off variance bias and makes the trained model simpler, thus effectively preventing overfitting. In addition, although the prediction performance of XGBoost is excellent, the model is very sensitive to parameters, and the use of an efficient parameter selection method is crucial to the prediction effect, and the experimental results confirm the superiority of the improved algorithm (COLGWO) proposed in this study in terms of hyperparameter selection.Table 7
Comparison of prediction accuracy of combined algorithms.
Algorithm nameRMSEMAEMAPEBagging-COLGWO-XGBoost904.515539.5512.759Bagging-COLGWO-GBDT2273.204819.2372.851COLGWO-XGBoost1211.977579.7783.235COLGWO-GBDT2419.8361086.3545.179GWO-XGBoost1230.206620.6524.823GWO-GBDT3084.1851260.10110.627Bold font indicates the best prediction accuracy among all models.Figure 4
Combined algorithm prediction effect.In summary, the overall prediction accuracy of the model optimized by the combined algorithm is better than that of the single model prediction. The Bagging-COLGWO-XGBoost model with the integrated strategy ranked first in all three evaluation metrics of all algorithms, improving 77.19%, 63.28%, and 71.8%, respectively, compared to XGBoost, and 60.21%, 34.14%, and 3.23%, respectively, compared to Bagging-COLGWO-GBDT. It indicates that the COLGWO algorithm proposed in this paper is very effective in the application of hyperparameter selection for the XGBoost model in the early warning problem of COVID-19. Combining with the Bagging integration strategy will further enhance the prediction effect.


## 4.1. Improved Algorithm Performance Testing

### 4.1.1. Standard Test Functions

We have selected eight typical standard test functions from the global optimization benchmark functionality library to test the optimization-seeking capability of the COLGWO algorithm, whose names, functions, search intervals, and theoretical minimum values are shown in Table3. f1x∼f4x are continuous single-peaked functions, which are typically used to test the local mining abilities of algorithms. f5x∼f8x are complex nonlinear multipeaked functions with a large number of local extremes, which are generally used to test the global pioneering abilities of algorithms, and their results provide guidance to algorithms.Table 3
Brief information on the 8 standard test functions.
Function nameFunction formSearch intervalMinimum valuef1xDiscusf1x=106x12+∑i=2Dxi2−100,1000f2xBent Cigarf2x=x12+106∑i=2Dxi2−100,1000f3xZakharovf3x=∑i=1Dxi2+∑i=1D0.5xi2+∑i=1D0.5xi4−100,1000f4xSpheref4x=∑i=1Dxi2−100,1000f5xRastriginf5x=∑i=1Dxi2−10cos2πxi+10−100,1000f6xGriewankf6x=∑i=1Dxi2/4000−∏i=1Dcosxi/i+1−100,1000f7xRosenbrockf7x=∑i=1D−1100xi2−xi+12+xi−12−100,1000f8xAckleyf8x=−20exp−0.21/D∑i=1Dxi2−exp1/D∑i=1Dcos2πxi+20+e−100,1000


### 4.1.2. Experimental Analysis

A comparison of the optimization performance of DE (differential evolution), PSO (particle swarm optimization), GWO, and COLGWO in eight typical benchmark test functions was conducted in the same runtime environment using Python version 3.7 as the simulation program. The primary parameters of the four algorithms were the same, namely 30 populations, a maximum number of iterations of 500, and a dimension of 30. The algorithms were run independently 30 times, and the mean and standard deviation of the search results were calculated. Table4 shows the experimental results. On the basis of Table 4, it can be observed that the optimization results of GWO outperform those of the two classical evolutionary algorithms, DE and PSO, for continuous single-peak functions and complex nonlinear multipeak functions. Even though the improved COLGWO algorithm does not achieve the theoretically optimal solution for the f8x function, it improves significantly compared to before the improvement, and it has the best solution accuracy among the four algorithms. It indicates that the modification of the standard GWO algorithm in this study is very effective, can well-balance the global search ability and local search ability, and improve the stability of the algorithm. For the eight standard test functions, Table 4 only displays the optimal values determined by the four algorithms. A comparison graph of the convergence of the four algorithms for the test functions is shown in Figure 2 for the purpose of visualizing the convergence of the algorithms. Based on Figure 2, the speed of convergence of COLGWO algorithm has been significantly accelerated. Because of this, the improved algorithm presented in this paper takes into account the convergence speed, global exploration ability, and local fine search ability of the algorithm at the same time, which is a very powerful improvement.Table 4
Optimization search results of four algorithms for standard test functions.
DEPSOGWOCOLGWOf1xAverage value0.007169528819623764.58E − 071.74E − 270Standard deviation0.008924343209060379.67E − 072.64E − 270f2xAverage value2459.11866144729 44831533444.98E − 220Standard deviation2438.7229420368315.266850179.28E − 220f3xAverage value0.2544996573124073.41E − 059.27E − 240Standard deviation0.6814256763075187.64E − 051.25E − 230f4xAverage value0.004406969619568761.15E − 076.60E − 280Standard deviation0.004890543235093371.96E − 078.25E − 280f5xAverage value211.3429011989911129.8809793.2168227960Standard deviation21.4117756082338421.97138174.9076232410f6xAverage value0.004071610547935630.0331675930.0034564940Standard deviation0.006369930452106430.0338204780.0075183880f7xAverage value34.99089558084770.0349191372.4857017320Standard deviation22.32833055762750.03595113312.084063810f8xAverage value20.980574001139120.478329349.9326191464.44E − 16Standard deviation0.1063985933675190.61818032510.411136010Figure 2
Algorithm adaptation evolution curve.


## 4.1.1. Standard Test Functions

We have selected eight typical standard test functions from the global optimization benchmark functionality library to test the optimization-seeking capability of the COLGWO algorithm, whose names, functions, search intervals, and theoretical minimum values are shown in Table3. f1x∼f4x are continuous single-peaked functions, which are typically used to test the local mining abilities of algorithms. f5x∼f8x are complex nonlinear multipeaked functions with a large number of local extremes, which are generally used to test the global pioneering abilities of algorithms, and their results provide guidance to algorithms.Table 3
Brief information on the 8 standard test functions.
Function nameFunction formSearch intervalMinimum valuef1xDiscusf1x=106x12+∑i=2Dxi2−100,1000f2xBent Cigarf2x=x12+106∑i=2Dxi2−100,1000f3xZakharovf3x=∑i=1Dxi2+∑i=1D0.5xi2+∑i=1D0.5xi4−100,1000f4xSpheref4x=∑i=1Dxi2−100,1000f5xRastriginf5x=∑i=1Dxi2−10cos2πxi+10−100,1000f6xGriewankf6x=∑i=1Dxi2/4000−∏i=1Dcosxi/i+1−100,1000f7xRosenbrockf7x=∑i=1D−1100xi2−xi+12+xi−12−100,1000f8xAckleyf8x=−20exp−0.21/D∑i=1Dxi2−exp1/D∑i=1Dcos2πxi+20+e−100,1000


## 4.1.2. Experimental Analysis

A comparison of the optimization performance of DE (differential evolution), PSO (particle swarm optimization), GWO, and COLGWO in eight typical benchmark test functions was conducted in the same runtime environment using Python version 3.7 as the simulation program. The primary parameters of the four algorithms were the same, namely 30 populations, a maximum number of iterations of 500, and a dimension of 30. The algorithms were run independently 30 times, and the mean and standard deviation of the search results were calculated. Table4 shows the experimental results. On the basis of Table 4, it can be observed that the optimization results of GWO outperform those of the two classical evolutionary algorithms, DE and PSO, for continuous single-peak functions and complex nonlinear multipeak functions. Even though the improved COLGWO algorithm does not achieve the theoretically optimal solution for the f8x function, it improves significantly compared to before the improvement, and it has the best solution accuracy among the four algorithms. It indicates that the modification of the standard GWO algorithm in this study is very effective, can well-balance the global search ability and local search ability, and improve the stability of the algorithm. For the eight standard test functions, Table 4 only displays the optimal values determined by the four algorithms. A comparison graph of the convergence of the four algorithms for the test functions is shown in Figure 2 for the purpose of visualizing the convergence of the algorithms. Based on Figure 2, the speed of convergence of COLGWO algorithm has been significantly accelerated. Because of this, the improved algorithm presented in this paper takes into account the convergence speed, global exploration ability, and local fine search ability of the algorithm at the same time, which is a very powerful improvement.Table 4
Optimization search results of four algorithms for standard test functions.
DEPSOGWOCOLGWOf1xAverage value0.007169528819623764.58E − 071.74E − 270Standard deviation0.008924343209060379.67E − 072.64E − 270f2xAverage value2459.11866144729 44831533444.98E − 220Standard deviation2438.7229420368315.266850179.28E − 220f3xAverage value0.2544996573124073.41E − 059.27E − 240Standard deviation0.6814256763075187.64E − 051.25E − 230f4xAverage value0.004406969619568761.15E − 076.60E − 280Standard deviation0.004890543235093371.96E − 078.25E − 280f5xAverage value211.3429011989911129.8809793.2168227960Standard deviation21.4117756082338421.97138174.9076232410f6xAverage value0.004071610547935630.0331675930.0034564940Standard deviation0.006369930452106430.0338204780.0075183880f7xAverage value34.99089558084770.0349191372.4857017320Standard deviation22.32833055762750.03595113312.084063810f8xAverage value20.980574001139120.478329349.9326191464.44E − 16Standard deviation0.1063985933675190.61818032510.411136010Figure 2
Algorithm adaptation evolution curve.


## 4.2. Comparison of Prediction Effects

### 4.2.1. Evaluation Functions

As evaluation functions for the forecasting models, we select root mean squared error (RMSE), mean absolute error (MAE), and mean absolute percentage error (MAPE). The model’s smaller RMSE, MAE, and MAPE values indicate better prediction performance, and the actual formula is as follows:(30)RMSE=1n∑i=1nyi−yi^2,MAE=1n∑i=1nyi−yi^,MAPE=100%n∑i=1nyi−yi^yi.Here,n is the number of samples, i is the sample number, yi stands for the true value, and yi^ stands for the predicted value of the model.


### 4.2.2. Experimental Analysis

The present study employs multiple algorithms as comparison models to evaluate the predictive ability of the Bagging-COLGWO-XGBoost model in the COVID-19 cumulative number of confirmations data. For single-model prediction, in addition to four traditional machine learning models of SVR, LR, MLP, and GDBT, convolutional neural networks (CNN) [30], recurrent neural network (RNN) [31], and long short-term memory (LSTM) [32], which are three classical deep learning models, were also selected to compare and analyze the prediction effect of XGBoost. In the combined algorithm prediction, the GWO-optimized XGBoost model (GWO-XGBoost), GWO-optimized GBDT model (GWO-GBDT), COLGWO-optimized GBDT (COLGWO-GBDT), COLGWO-optimized XGBoost (COLGWO-XGBoost), and Bagging-COLGWO-GBDT are selected to compare and analyze the prediction effects of the Bagging-COLGWO-XGBoost model proposed in this study. Table 5 contains the parameters of each algorithm model.Table 5
Algorithm-related parameters.
ModelParameter settingBagging-COLGWO-XGBoostn_estimators = 21Bagging-COLGWO-GBDTn_estimators = 21COLGWO-XGBoostn_estimators = 18; learning_rate = 0.8561; max_depth = 7COLGWO- GBDTn_estimators = 22; learning_rate = 0.3208; max_depth = 4GWO-XGBoostn_estimators = 46; learning_rate = 0.8563; max_depth = 6GWO-GBDTn_estimators = 38; learning_rate = 0.5996; max_depth = 4XGBoostDefault parameterGBDTDefault parameterLSTMOptimizer = Adam; loss = mse; epochs = 100RNNOptimizer = Adam; loss = mse; epochs = 100CNNOptimizer = Adam; loss = mse; epochs = 100SVRDefault parameterMLPDefault parameterLRDefault parameterCOLGWOIteration number: 100; Population size: 30GWOIteration number: 100; Population size: 30The main model and the comparison model proposed in this paper are fitted to each prediction model in the training dataset, and the predictions are performed on the test dataset. The prediction accuracy of the single model in the three indexes is given in Table6, and Figure 3 shows the prediction effect of the single model. It can be observed that the prediction performance of XGBoost and GBDT in single model is significantly better than SVR, MLP, LR, CNN, RNN, and LSTM. XGBoost ranked first in MAPE, and GBDT ranked first in RMSE and MAE. Both models outperformed several other comparative models in three metrics, RMSE, MAE, and MAPE, and this result indicates that the selection of a suitable regression model plays a key role in improving the prediction performance under the same data premise.Table 6
Single model prediction accuracy comparison.
Algorithm nameRMSEMAEMAPEXGBoost3965.7251469.4069.785GBDT3095.0051356.61910.753SVR8591.4447199.914223.206MLP8551.8566216.56686.296LR4683.8083406.161116.283LSTM4854.7583522.86712.967RNN6506.4144936.08232.877CNN5862.4564442.03927.082Bold font indicates the best prediction accuracy among all models.Figure 3
Single model prediction effect.To further observe the difference in prediction performance between GBDT and XGBoost, in the combined algorithm, the GWO-seeking algorithm is first proposed to optimize the hyperparameters of these two models separately, and then the COLGWO proposed in this paper is used to compare the optimization results. Finally, the Bagging strategy is used to integrate the learning of these two models. Table7 and Figure 4 show the experimental results of the combined algorithm. After using the GWO optimization algorithm, the prediction accuracy of GBDT is slightly improved, however, it significantly lags behind that of XGBoost, Using COLGWO for the parameter optimization of both models achieves better optimization results than GWO. Using the Bagging integration strategy can further reduce the generalization error of the combined algorithm, and this strategy has the best prediction effect when combined with XGBoost using COLGWO algorithm. It shows that the improvement of XGBoost on GBDT is successful. Since the model adds a regular term in the loss function for controlling the complexity of the model, it reduces the variance of the model in terms of the trade-off variance bias and makes the trained model simpler, thus effectively preventing overfitting. In addition, although the prediction performance of XGBoost is excellent, the model is very sensitive to parameters, and the use of an efficient parameter selection method is crucial to the prediction effect, and the experimental results confirm the superiority of the improved algorithm (COLGWO) proposed in this study in terms of hyperparameter selection.Table 7
Comparison of prediction accuracy of combined algorithms.
Algorithm nameRMSEMAEMAPEBagging-COLGWO-XGBoost904.515539.5512.759Bagging-COLGWO-GBDT2273.204819.2372.851COLGWO-XGBoost1211.977579.7783.235COLGWO-GBDT2419.8361086.3545.179GWO-XGBoost1230.206620.6524.823GWO-GBDT3084.1851260.10110.627Bold font indicates the best prediction accuracy among all models.Figure 4
Combined algorithm prediction effect.In summary, the overall prediction accuracy of the model optimized by the combined algorithm is better than that of the single model prediction. The Bagging-COLGWO-XGBoost model with the integrated strategy ranked first in all three evaluation metrics of all algorithms, improving 77.19%, 63.28%, and 71.8%, respectively, compared to XGBoost, and 60.21%, 34.14%, and 3.23%, respectively, compared to Bagging-COLGWO-GBDT. It indicates that the COLGWO algorithm proposed in this paper is very effective in the application of hyperparameter selection for the XGBoost model in the early warning problem of COVID-19. Combining with the Bagging integration strategy will further enhance the prediction effect.


## 4.2.1. Evaluation Functions

As evaluation functions for the forecasting models, we select root mean squared error (RMSE), mean absolute error (MAE), and mean absolute percentage error (MAPE). The model’s smaller RMSE, MAE, and MAPE values indicate better prediction performance, and the actual formula is as follows:(30)RMSE=1n∑i=1nyi−yi^2,MAE=1n∑i=1nyi−yi^,MAPE=100%n∑i=1nyi−yi^yi.Here,n is the number of samples, i is the sample number, yi stands for the true value, and yi^ stands for the predicted value of the model.


## 4.2.2. Experimental Analysis

The present study employs multiple algorithms as comparison models to evaluate the predictive ability of the Bagging-COLGWO-XGBoost model in the COVID-19 cumulative number of confirmations data. For single-model prediction, in addition to four traditional machine learning models of SVR, LR, MLP, and GDBT, convolutional neural networks (CNN) [30], recurrent neural network (RNN) [31], and long short-term memory (LSTM) [32], which are three classical deep learning models, were also selected to compare and analyze the prediction effect of XGBoost. In the combined algorithm prediction, the GWO-optimized XGBoost model (GWO-XGBoost), GWO-optimized GBDT model (GWO-GBDT), COLGWO-optimized GBDT (COLGWO-GBDT), COLGWO-optimized XGBoost (COLGWO-XGBoost), and Bagging-COLGWO-GBDT are selected to compare and analyze the prediction effects of the Bagging-COLGWO-XGBoost model proposed in this study. Table 5 contains the parameters of each algorithm model.Table 5
Algorithm-related parameters.
ModelParameter settingBagging-COLGWO-XGBoostn_estimators = 21Bagging-COLGWO-GBDTn_estimators = 21COLGWO-XGBoostn_estimators = 18; learning_rate = 0.8561; max_depth = 7COLGWO- GBDTn_estimators = 22; learning_rate = 0.3208; max_depth = 4GWO-XGBoostn_estimators = 46; learning_rate = 0.8563; max_depth = 6GWO-GBDTn_estimators = 38; learning_rate = 0.5996; max_depth = 4XGBoostDefault parameterGBDTDefault parameterLSTMOptimizer = Adam; loss = mse; epochs = 100RNNOptimizer = Adam; loss = mse; epochs = 100CNNOptimizer = Adam; loss = mse; epochs = 100SVRDefault parameterMLPDefault parameterLRDefault parameterCOLGWOIteration number: 100; Population size: 30GWOIteration number: 100; Population size: 30The main model and the comparison model proposed in this paper are fitted to each prediction model in the training dataset, and the predictions are performed on the test dataset. The prediction accuracy of the single model in the three indexes is given in Table6, and Figure 3 shows the prediction effect of the single model. It can be observed that the prediction performance of XGBoost and GBDT in single model is significantly better than SVR, MLP, LR, CNN, RNN, and LSTM. XGBoost ranked first in MAPE, and GBDT ranked first in RMSE and MAE. Both models outperformed several other comparative models in three metrics, RMSE, MAE, and MAPE, and this result indicates that the selection of a suitable regression model plays a key role in improving the prediction performance under the same data premise.Table 6
Single model prediction accuracy comparison.
Algorithm nameRMSEMAEMAPEXGBoost3965.7251469.4069.785GBDT3095.0051356.61910.753SVR8591.4447199.914223.206MLP8551.8566216.56686.296LR4683.8083406.161116.283LSTM4854.7583522.86712.967RNN6506.4144936.08232.877CNN5862.4564442.03927.082Bold font indicates the best prediction accuracy among all models.Figure 3
Single model prediction effect.To further observe the difference in prediction performance between GBDT and XGBoost, in the combined algorithm, the GWO-seeking algorithm is first proposed to optimize the hyperparameters of these two models separately, and then the COLGWO proposed in this paper is used to compare the optimization results. Finally, the Bagging strategy is used to integrate the learning of these two models. Table7 and Figure 4 show the experimental results of the combined algorithm. After using the GWO optimization algorithm, the prediction accuracy of GBDT is slightly improved, however, it significantly lags behind that of XGBoost, Using COLGWO for the parameter optimization of both models achieves better optimization results than GWO. Using the Bagging integration strategy can further reduce the generalization error of the combined algorithm, and this strategy has the best prediction effect when combined with XGBoost using COLGWO algorithm. It shows that the improvement of XGBoost on GBDT is successful. Since the model adds a regular term in the loss function for controlling the complexity of the model, it reduces the variance of the model in terms of the trade-off variance bias and makes the trained model simpler, thus effectively preventing overfitting. In addition, although the prediction performance of XGBoost is excellent, the model is very sensitive to parameters, and the use of an efficient parameter selection method is crucial to the prediction effect, and the experimental results confirm the superiority of the improved algorithm (COLGWO) proposed in this study in terms of hyperparameter selection.Table 7
Comparison of prediction accuracy of combined algorithms.
Algorithm nameRMSEMAEMAPEBagging-COLGWO-XGBoost904.515539.5512.759Bagging-COLGWO-GBDT2273.204819.2372.851COLGWO-XGBoost1211.977579.7783.235COLGWO-GBDT2419.8361086.3545.179GWO-XGBoost1230.206620.6524.823GWO-GBDT3084.1851260.10110.627Bold font indicates the best prediction accuracy among all models.Figure 4
Combined algorithm prediction effect.In summary, the overall prediction accuracy of the model optimized by the combined algorithm is better than that of the single model prediction. The Bagging-COLGWO-XGBoost model with the integrated strategy ranked first in all three evaluation metrics of all algorithms, improving 77.19%, 63.28%, and 71.8%, respectively, compared to XGBoost, and 60.21%, 34.14%, and 3.23%, respectively, compared to Bagging-COLGWO-GBDT. It indicates that the COLGWO algorithm proposed in this paper is very effective in the application of hyperparameter selection for the XGBoost model in the early warning problem of COVID-19. Combining with the Bagging integration strategy will further enhance the prediction effect.


## 5. Conclusions

This work analyses the initial web search data associated with COVID-19 at the time of its outbreak and then uses the LASSO method to select features for input into the model of XGBoost for prediction. A new grey wolf algorithm is proposed to optimize the hyperparameters of XGBoost to improve prediction accuracy. We built a Bagging-COLGWO-XGBoost early warning model, which utilizes the Bagging integration strategy, to enhance the generalizability of the combined algorithm. After analyzing the comparison of these early warning models, the subsequent conclusions were drawn.Firstly, the data source affects the accuracy and timeliness of the prediction model. Web search data has many advantages over traditional statistics, and it is convenient, timely, and sensitive to user needs, which can effectively supplement traditional statistics.Secondly, to address the shortcomings of the standard GWO algorithm, such as low solution accuracy, slow convergence speed, and it being easy to fall into the local optimum and impossible to jump out, it was proposed in this paper that COLGWO initially employed a mechanism based on backward learning to initialize the population. Adding jump probabilities makes the algorithm jump out of the local optimal solution. Additionally, to enhance the mining ability of the standard GWO algorithm, a chaotic search operator was developed, which uses chaotic sequences to carry out local searches around the current optimal solution. Experimental results demonstrate that the improved grey wolf algorithm satisfies the purpose of balancing the global and local search for optimal solutions of the algorithm and that the optimization results in all eight standard test functions are vastly superior to those of the grey wolf algorithm. Also, the results demonstrate that the optimization of hyperparameters of the XGBoost model using it can significantly improve prediction accuracy.Thirdly, in terms of prediction performance, the use of Bagging-integrated learning can result in a reduction in the variance of the predictive model and enhance generalization capability. The Bagging-COLGWO-XGBoost model presented in this paper performs significantly better than the thirteen other models in the prediction problem of the cumulative number of confirmed COVID-19 cases in China, indicating that the model is a good and reliable one.Overall, the combined predictive model Bagging-COLGWO-XGBoost developed in this study combined with web search data can predict the cumulative number of confirmed cases of COVID-19 in China under this emergency situation. In addition, this model may be continuously updated and optimized according to the latest data to provide real-time prediction, which will serve as a reliable source of data for the Chinese government to formulate reasonable and effective health policy. Furthermore, the model constructed in this study can also be used for the prediction of similar major public emergencies and can be extended to other public emergencies related to early warning.



---

*Source: 1314459-2022-06-03.xml*