The recent outbreak of COVID-19 and the world-wide panic surrounding it calls for urgent measures to contain the epidemic. Predicting the speed and severity of infectious diseases like COVID-19 and allocating medical resources appropriately is central to dealing with epidemics. The role of data science in this issue was brought to light when in December 2013, the first cases of Chikungunya virus appeared in the Americas. In 2014 DARPA announced a Grand Challenge [1] to predict the spread of Chikungunya virus in 55 countries of the western hemisphere. Through monthly predictions and reevaluation over seven months, DARPA announced the top winners of the challenge which included our team [2] . While many winning methods relied on manual adjustments for generating predictions, ours was a completely automated approach, thus more generalizable. However, training such a model with rapidly changing epidemic trends is difficult. Often epidemic models are trained through numerical solutions to differential equations [3] or through Bayesian inference [4, 5] . Instead, we transform the model into a linear system and train it using weighted least squares. The more recent data is more heavily weighted to adapt to rapidly changing trends. Further, we explore various hyper-parameter selection strategies to identify the best model.
Learning the model also enables understanding of the dynamics of the epidemic and how it has changed over time. We utilize the changing parameters to study how various countries and US states have responded to the epidemic. We do so by proposing two measures: (i) Contact Reduction Score that measure how much a region has reduced transmission; (ii) and Epidemic Reduction Score that measures how much reduction in confirmed cases a region has achieved compared to a hypothetical scenario where the trends had remained the same as a reference day in the past. Further it enables analysis of scenarios into the future, for instance, what would be the trend of the epidemic if social distancing orders were released.
While we perform our analysis at state and country level. In the future, we plan to generate similar predictions at county and city level. Applying such machine learning-based models to a finer level (from countries to states/cities) and larger scale (more 'regions' of the world) brings unique challenges in terms of unreported/noisy data and large number of model parameters, which will be explored in a future work. In this paper, we present some of our initial results on country and state-level predictions. We forecast number of reported cases for US states and for all the countries. We understand that majority of the infections are conjectured to be unreported [6] . We still believe that number of reported cases is a good indicator of the stress on the healthcare system. Henceforth, "number of infected cases" refers to the number of reported cases. In future work, we plan to incorporate modeling of unreported cases informed by various ongoing antibodies studies. We are also developing an interactive customizable tool that can be used to perform predictions using our model. A preliminary version of the tool has been made publicly available 1 .
We propose an epidemic model ( Fig. 1 ) for spread of a virus like COVID-19 across the world which captures (i) temporally varying infection rates (ii) arbitrary regions, and (iii) human mobilty patterns. Within every region (hospital/city/state/country), an individual can exist in either one of two states: susceptible and infected. A susceptible individual gets infected when in contact with an infected individual at a rate depending on when that individual got infected, i.e., rate of infection is β 1 for an individual infected at t − 1, β 2 for an individual infected at t − 2, and so on, thus resulting in k sub-states of infection. The hypothesis is that how actively one passes on the infection is affected by when they get infected. We assume that after being infected for a certain time, individuals no longer spread the infection, i.e., ∃k, such that β i = 0∀i > k. Also, people traveling from other regions can increase the number of infections in a given 1 https://jaminche.github.io/COVID-19/ region. We assume that this infection can happen because of human mobility. Suppose F (q, p) represents mobility from region q to region p. Our model is represented by the following system of equations.
Here, S p t and I p t represent the number of susceptible individuals and infected individuals respectively in the region p at time t. Parameter δ captures the influence of passengers coming into the region.
To deal with the fact that using large values of k may overfit the model and that data is likely to be noisy, we incorporate another hyperparameter J in Eq 2 as follows:
This creates a dependency on last kJ days with k parameters while having a "smoothing" effect due to combining infections over J days. Note that if we set k = 1, J = ∞, and ignore mobility (δ = 0), this reduces to Suceptible-Infected (SI) model [7] . On the other hand, with bounded k = 1 and J < ∞, the model is a variation of Suceptible-Infected-Released/Recovered (SIR) model [8] , where an infected individual is active for J units of time. While the model is applicable to any definition of regions, in this work, we focus on country-level and US state-level forecasts, only. Further, there is a lag between an individual contracting the virus and their case being reported. We do not account for this lag, assuming that it is constant. County-level and city-level forecasting accounting for the lag and unreported cases is planned for future work.
To train the model, we linearize it, by setting δ p i = δβ p i and learning it as an independent parameter. This makes the model more general by allowing different infection rates for the travelers. This is different from traditional approach of fitting one curve to the data with fixed initial values, which is computationally expensive and cannot capture rapidly changing trends. Let
Then, our model can be represented by the linear equation ∆I p which allows us to learn the parameters using a constrained linear solver. This formulation works only if k and J are same for all regions. To allow different hyper-parameters for different regions, we used a further simplification:
And,
To incorporate the fast evolving trend of COVID-19 due to changing policies, we use weighted least squared to learn parameters β p i and δ p i from available reported data. The best fit in the least-squares sense minimizes the sum of squared weighted residuals, i.e., the difference between observed data and predicted values provided by our learned model. We incorporate a forgetting factor α ≤ 1 in our minimization to put more weight to the recent infection trend when learning the model. Lower α implies more emphasis on the more recent data. We compute the minimum of the sum of squares of weighted errors as
where ∆Î p t is the actual number of newly infected individual.
We present our analysis on two datasets -(i) Global: country-level data with each country defined as a region; and (ii) US states: state-level data for Unites States with each state defined as a region. Country-level infections were derived from confirmed cases obtained from JHU CSSE COVID19 dataset [9] . Population of the countries were obtained from the World Bank dataset [10] . Inter-country travel data were obtained from KCMD Global Transnational Mobility dataset [10] , which makes the estimation on the basis of global statistics on tourism and air passenger traffic. Number of infections for US states were obtained from confirmed cases compiled by New York Times [11] . Population of each state was obtained from US Census Bureau [12] . Inter-state travel was estimated from number of flights flying between airports in the United States [13] .
The hyper-parameters to be picked include k, J, and α. The best hyper-parameter set is identified by a grid search on k, J, and α, which minimizes the Root Mean Squared Error over a validation set of H = 3:
We pick α from {0.1, 0.2, . . . , 1.0}, while k, J ∈ {1, 2, . . . , 14}. We enforce Jk ≤ 14 days so that the dependence of new infections is bounded by the previous two weeks. This is along the lines of the motivation for 14 days of quarantine 2 . We experiment with two methods of setting the hyper-parameters: (i) fixed -same set of hyper-parameters for all countries/states (ii) variable -specialized parameters for each state/country. The results are presented next.
We evaluated the results for a horizon H = 3 with two hyper-parameters selection schemes termed SI-kJα (variable) and SI-kJα (fixed). The best heper-parameters were selected by further splitting the training data, to set the last three days for validation. We compare these results against a recent generalized version of SEIR model [14] .
Besides RMSE, we also measure the mean absolute percentage error given by
The comparison is shown in Tab. 1. We used a publicly available implementation of the baseline 3 . We observe that both fixed and variable hyper-parameter selections widely outperformed the baseline. Performances of both fixed and variable scheme were comparable. We use the average of both predictions as an 'ensemble' prediction which performed better than both schemes, individually. It should be noted that the number of cases across different countries has orders of magnitude difference. Filtering out countries with small number of cases will significantly reduce MAPE but increases RMSE. As an example, considering only US for country-level prediction, the RMSE for all three (fixed, variable, and ensemble) is 6886.9, which translates to 1.12% MAPE. All the code used in our experiments are available on Github 4 . 11.37% Gen-SEIR [14] 2106. 4 14.31% 7471.2* 41.06%* Our approach with variable hyper-parameter set has the best performance in terms of both MAPE and RMSE. *For some countries, the baseline method could not converge and for some the produced MAPE was greater than 100%. We ignore those countries to favor the baseline which results in averaging over 147 countries. Fig. 2 shows the test results using SI-kJα (ensemble) prediction on H = 5 days for four US states. These were arbitrarily selected; other states show similar results as well. Fig. 3 shows the test results on H = 5 days for four countries. Again, these were arbitrarily selected. Note that the predictions are extremely accurate. For these results, we set all mobility terms (F (p, q)) to zero to reflect that due to "stay-at-home" policy around the world, the recent spread due to travel is negligible. This also reduces the number of parameters to be learned. For an earlier date, we include mobility and discuss the details next.
To measure the effect of travel, we train our model with data until March 18th, with and without travel data. The next three days are used as validation set to identify best hyper-parameters and the following three days are used as test set for evaluation. Table 2 shows validation and test errors for both variable and fixed hyperparameter selection scheme, each with and without travel. Observe that in all cases including travel data reduces RMSE in the test set. For US states, variable hyper-parameter scheme performs better, while for Global, fixed scheme has a lower RMSE. This may be due to lack of enough data resulting in overfitting of variable hyperparameter scheme. This is evident from the fact that the validation errors are much lower than the test errors. This observation also supports the decision of going forward with the ensemble approach instead of choosing one of variable or fixed schemes. 
Since the speed of infection is driven by β p i , we can assess the effect of a region's effort to battle COVID-19 by the change observed in these parameters. We measure the number of transmissions a susceptible person receives from an infected individual, assuming the infections are uniformly distributed across all sub-states. Another approach to define this quantity is to measure the number of new infections, given that past infections are uniformly increasing. This allows us to quantify a measure of "contact" without relying on the state of individuals (infected/susceptible) in the population as
We define Contact Reduction Score (CRS) for a region (country/state) as the fractional change in this number of transmissions:
We picked a date in the middle of March as the reference day to learn τ p N (old), and compared against τ p N (new) obtained from training up to April 10. Since, the ensemble approach for hyper-parameters selection has the best performance, we compute the number of transmissions as the average of transmissions obtained from both scenarios. Further, we also define Epidemic Reduction Score, which measures the fractional reduction in number of infections compared to the scenario where the trend of infection at reference day had continued.
The Reduction Scores for US states and global countries are shown in Fig. 4 . We ignored all the regions that had less than 100 cases for US state-level and 1000 cases from country-level data on the reference day in order to make the comparison reliable.
Among the 30 US states that qualify based on the threshold of 100 cases at baseline, the state with best CRS was New Jersey, and Minnesota scored the worst. Mississippi has the top ERS with Massachusetts at the bottom of the list. Mississippi is also close to New Jersey in CRS. We note that Mississippi has been awarded between C and F since the reference day to early April for its "Social Distancing" score by Unacast 5 . This suggests that while "Social Distancing" score captures percentage reduction in average mobility, it does not provide the complete picture of the changes in infection dynamics. A visual inspection reveals that Mississippi has indeed shown significant change (Fig. 5) compared to reference day when number of infections were increasing much more rapidly. At country-level, Brazil has the best CRS with Japan at the bottom, among 22 countries selected based on a threshold of 1000 infections at reference day. Based on ERS, US tops the list with Japan at the bottom again. We emphasize that these rankings are sensitive to the reference day.
While both CRS and ERS measure a region's response to the epidemic, we believe that CRS is a better metric to evaluate a region's efforts. This is due to the fact that CRS only depends on the model parameters that can be controlled by limiting contact with others and other policies to reduce transmission. On the other hand, ERS depends on number of current/past infections which are not completely controlled by changing policies. For instance, a country which already has large number of cases (yet significantly less than its susceptible population) will experience a higher increase compared to a country with fewer cases, even when they have identical model parameters.
We can use our models not only to generate forecasts, but also for emulating scenarios.
As an example, we compute forecasts with two models: (i) a model trained on most recent data with no inter-region mobility, and (ii) a model trained on data until mid-March (reference day) including inter-region mobility. The reference day was set to middle of March as the majority of US states and countries had not actively imposed "social distancing" suggestion. The results with both models are shown in Figs. 6 and 7. Instead of showing a single curve for forecasts, we show a range owing to the difference in fixed and variable hyper-parameter schemes. All plots suggest that, even though the current trend is leading to limited number of infections, immediately releasing all precautions can result in a rapid rise of the epidemic. 
We have proposed two schemes for selecting hyper-parameters, fixed and variable. While both schemes have similar performance, variable scheme has a significant difference in test and validation error, suggesting that it is prone to over-fitting. On the other hand, with more data this issue may be resolved. While, currently our 'ensemble' approach is simply the average of the predictions using both schemes, the ideal approach may be a hybrid one, where a collection of regions share the same hyper-parameters. This is especially useful when there are very few cases in a region. Then the hyper-parameters and even the parameters for this region can be set to be equal to that of a "similar" region from where more data is available. One way to identify such similar regions is by clustering regions based on their trends in a previous epidemic. In this way, active reporting for COVID-19 can be used to improve forecast of the next epidemic at an early stage. We will explore this in a future work.
We have only modeled reported cases, as they are an indicator of the stress on the healthcare system. However, unreported cases may affect the long term dynamics. The unreported cases can be classified into two categories: (i) unreported cases -those who get infected over the course of the epidemic but do not report it; and (ii) immune casesthose who have the antibodies without being infected during the epidemic. For unreported cases, we can add another state to our model: for an individual in the i th "infected" sub-state, a report will be made with probability γ p i . Thus, the total number of new reported cases is given by ∆R = k i=1 γ p i ∆I p t−i . Then the parameters will be learned by fitting the reported cases to R p t . The immune cases can be modeled as considering them not-susceptible. Suppose, ρ p is the probability of a randomly selected individual in region p to be immune. Then the number of susceptible individuals at time t is given by S p t = (1 − ρ p )N p − I p t . We can integrate these cases complemented by the ongoing various anti-body studies and surveys that will assist with more accurate learning of the parameters. Learning these parameters from the data without considering these studies is difficult. This is due to the fact that the number of total cases, even if it is 100 times the reported cases, is currently a very small fraction of the population. As of now, we allow γ p i and ρ p to be inputs in our model. These can be used to study long-term scenarios with various inputs. For example, Fig. 8 shows the number of new positive cases (reported) for various values of γ p i = γ. 