# COVID-19 Pandemic Prediction for Hungary; A Hybrid Machine Learning Approach
## 2 Materials and Methods
### Methods and Modeling Strategy
#### 2.2.1 Hybrid Multi-Layered Perceptron-Imperialist Competitive Algorithm (MLP-ICA)  
Multi-layered-perceptron (MLP) is the frequently used ANN method for prediction and modeling purposes. This technique, as a single method, provides acceptable accuracy for prediction tasks in the simple and semi-complex datasets. However, in the case of doing modeling tasks in complex datasets, there is a need for more robust techniques [80; 81]. For this reason, hybrid methods have been growing [80; 81]. Hybrid methods contain a predictor and one or more optimizers [80; 81]. The present study develops a hybrid MLP-ICA approach as a robust hybrid algorithm for generating a platform for predicting the COVID-19 cases and mortality rate in Hungary. The ICA is a method in the field of evolutionary calculations that seeks to find the optimal answer to various optimization problems. This algorithm, by mathematical modeling, provides a socio-political evolutionary algorithm for solving numerical optimization problems [82]. Like all algorithms in this category, the ICA constitutes an initial set of possible answers. These answers are known as countries in the ICA. The ICA gradually improves the initial responses and ultimately provides the appropriate solution to the optimization problem [82; 83].  
The algorithms are based on the policy of assimilation, imperialist competition, and revolution. This algorithm, by imitating the process of social, economic, and political development of countries and by mathematical modeling of parts of this process, provides operators in the form of a regular algorithm that can help to solve complex optimization problems [82; 84]. In fact, this algorithm looks at the answers to the optimization problem in the form of countries and tries to gradually improve these answers during a repetitive process and eventually reach the optimal answer to the problem [82; 84]. In the _Nvar_ dimension optimization problem, a country is an array of \(Nvar\times 1\) length. This array is defined as follows:  
\[country=[p1,\ p2,\ \ldots,\ pNvar] \tag{6}\]  
To start the algorithm, the country's initial number is generated (\(N_{country}\)). To select the \(N_{imp}\) as the best members of the population (countries with the lowest amount of cost function) as imperialists. The rest of the \(N_{col}\) countries form colonies, belonging to an empire. To divide the early colonies between the imperialists, imperialist owns a number of colonies, the number of which is proportional to its power [82; 84]. The following figure symbolically shows how the colonies are divided among the colonial powers.  
The integration of this model with the neural network causes the error in the network to be defined as a cost function, and with the changes in weights and biases, the output of the network improves, and the resulting error decreases [85]. The most important factors in training an ANN-ICA method contain the number of countries, imperialists, and decades and the number of neurons in the hidden layer, which can be defined in different ways. One of the common ways for defining them is trial and error.  
\begin{table}
\begin{tabular}{c c c} \hline \hline  & **Inputs** & **Outputs** \\ \hline Scenario 1 & \(x_{t-1}\), \(x_{t-3}\), \(x_{t-5}\) and \(x_{t-7}\) & \(x_{t}\) \\ Scenario 2 & \(x_{t-2}\), \(x_{t-4}\), \(x_{t-6}\) and \(x_{t-8}\) & \(x_{t}\) \\ \hline \hline \end{tabular}
\end{table}
Table 1: Two proposed scenarios for time-series prediction of COVID-19 in Hungary.  
In the present study, inputs and outputs of each scenario are imported into the model. The number of countries, imperialists, and decades have been defined by trial and error. For developing an MLP model, three architectures including 4-10-1, 4-14-1, and 4-18-1 (with 10, 14, and 18 neurons in the hidden layer, respectively) are used.