# Predicting the Spread of a Pandemic Using Machine Learning: A Case Study of COVID-19 in the UAE
## 3 Methods and Datasets
### Machine Learning Models  
Several models were trained to predict the future values in this time series problem based on different input conditions. These models were selected from the best performing models in the literature review and were used in addition to the LSTM-AE and bidirectional AE models that were not used by any of the works in the literature review. The first model used in this work is Least Absolute Shrinkage and Selection Operator (LASSO) Regression. It is a variation of the general linear regression algorithm which tries to express the output as a linear combination of attributes with pre-determined weights [30]. It generates a linear equation by summing the product between attributes and their weights, as seen in Equation (1). \[y=w_{0}+w_{1}a_{1}+w_{2}a_{2}+\cdots+w_{k}a_{k}, \tag{1}\]  
where \(w_{k}\) stands for the weight to be applied on attribute \(a_{k}\) and \(y\) stands for the output variable to be predicted using the linear equation. The advantage of this model is that it is suitable for multicollinear data [31]. Unlike multivariate regression, where all the attributes are used in the regression, the LASSO algorithm adds the attributes one at a time, and if the new feature does not improve the fit enough to outweigh the penalty term by including the feature, then it cannot be added. This helps make the model sparse with few coefficients [12]. The second model trained is the Exponential Smoothing model. This model is commonly used in all the work related to the forecasting of COVID-19 using classical machine learning techniques as it is well known to work well with lesser amount of data [32]. Exponential Smoothing is a powerful forecasting model, especially for univariate data. Figure 1: Proposed methodology that demonstrates the flow of getting the data until forecasting and results analysis. Univariate data is a type of data that consists of observations only on a single attribute. In this model, the influence of past data observations decays exponentially as it becomes older. Hence, the weight assigned to different lag values is reduced [12]. Equation (2) is used to forecast for current time \(y_{t}\). \[y_{t}=\alpha x_{t-1}+(1-\alpha)y_{t-1}, \tag{2}\]  
where \(\alpha\) is the smoothing cost that is \(0<=\alpha<=1\), \(x_{t-1}\) is the actual value of the previous history in the time series and \(y_{t-1}\) is the predicted value of the previous forecast [8]. The smoothing cost is similar to the weights used in deep learning models. Another model used is a classic LSTM. LSTM is a deep learning model that is commonly used for forecasting in time series. LSTM networks works with memory blocks that were created to solve vanishing gradients by memorizing network parameters for long durations [23]. A vanishing gradient simply means that the model is unable to change the weights applied to the nodes. The memory blocks are like the differential storage systems of a digital systems gate. The information is processed within these gates with the help of an activation sigmoid function and gives an output of 0 or 1. Sigmoid is used, as we require that only positive values to be passed on [23]. They are generally built with three gates being input gate, forget gate, and output gate. The input gate gives information that needs to be stored in the cell state. The forget gate throws information based on the forget-gate activation equation, and finally, the output gate combines information from the cell state and forget state at a certain time step t to generate the output. The gradients and weights are shared throughout for long durations and, by adjusting them, we can adjust the time scale to detect the dynamically changing parameters [33] and hence avoid the vanishing gradient factor. The following equations [33] illustrate the three gates.