{'fraction_non_alphanumeric': 0.02509573304157549, 'fraction_numerical': 0.011146061269146608, 'mean_word_length': 4.688448074679113, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Predicting COVID-19 Cases in Indian States using Random Forest Regression

Introduction: Coronaviruses are single-stranded RNA viruses that affect human and non-human mammals and birds. Coronavirus disease (COVID-19) is an infectious disease caused by a newly discovered coronavirus. The World Health Organization (WHO) declared this as a pandemic on the 11th of March 2020. Since then, governments have been on war footing imposing lockdowns with various restrictions, ramping up medical infrastructure and creating awareness among the people asking them to wear masks, to follow physical distancing, to wash hands regularly and various other safety measures. Objective: To forecast the number of cases in the states of Tamil Nadu and Maharashtra for 20 days and visualize the numbers for each state. Methods: Different approaches using the number of deaths, the number of recovered have experimented, but the results using the number of tests done turned out to be more accurate. The authors have presented a methodology that could predict the number of infections based on the number of tests done using the Random Forest Regressor method. The forecast helps in estimating the spread of the disease and act as a tool for the government to take appropriate actions. Results and Conclusion: It was concluded that the accuracy of the predictions was heavily dependent on the consistency of the number of tests taken. More consistency, greater accuracy.


INTRODUCTION
The COVID-19 pandemic is caused by Severe Acute Respiratory Syndrome Coronavirus 2 (SARS-CoV-2). 1 The first case in India was reported on 30 January 2020 in the state of Kerala. India has the largest number of confirmed cases in Asia and stands only behind the United States of America worldwide.
The virus spreads through small droplets released when people talk, sneeze or cough. The droplets don't travel a long distance. Instead, droplets of the virus fall on the ground, stay suspended in the air or cling on to a surface. A person testing positive can be symptomatic or asymptomatic. In case of asymptomatic case, common symptoms include fever, cough, cold, irritation in the throat, breathing difficulty, loss of taste sense and fatigue. Personal safety measures like Social Distancing, wearing masks and washing hands with soaps or sanitisers (commonly abbreviated as SMS of Co-rona) are being practised to contain the spreading of the virus. And governments worldwide are imposing lockdowns with various degrees of restrictions. 2 To date, there isn't any vaccine approved by the World Health Organization. Various scientists are working at neck-breaking speeds to come out with a vaccine as sooner as possible.
As of September 28, 2020, there are over 6 million total confirmed cases in India. 3 And around 1 lakh people have succumbed to the virus. Gradually the total daily numbers are increasing and it's an alarming sign. The government has gradually started to 'unlock' in phases. People have started to get back to work and the economy is slowly getting back on track. The pandemic has affected almost all people in some form or the other. Successive lockdowns were imposed that disturbed the nation's functioning on the whole. People were forced to stay at homes to contain the spread. 4 Initially, the people who were returning from abroad tested positive for the virus. Later it started spreading to their contacts and eventually it started spreading locally. Forecasting the cases for the next few days helps governments to be better prepared to tackle this pandemic.
In this paper, We have compared two of the most affected states -Maharashtra and Tamil Nadu with 13.4 lakh and 5.8 lakh cases as of September 30, 2020. The Test Positivity Rate (TPR), which is calculated by diving the number of confirmed cases by the number of tests done, daily and cumulative numbers of testing and the confirmed cases between the two states are visualized and interpreted by the authors in this paper. 5 For forecasting of the confirmed cases each day, Random Forest Regression was used. The model was trained with 4 months' data and the prediction was done for 20 days and the results were observed. 6

Related Work
Arora et al. 2 used various deep learning models such as Bi-Directional LSTM, Convolutional LSTM and Deep LSTM to predict cases in all of India's States and Union Territories. According to the authors, based on the metric 'prediction error', bi-directional LSTM and convolutional LSTM gave the best and worst results respectively. Also, based on daily and weekly predictions, bi-directional LSTM gave better results for short-term prediction.
Farooq and Bazaz et al. 3 proposed an Artificial Neural Network (ANN) based online incremental learning technique to forecast the pandemic in India. The unique feature of this model is that it adapts itself to new datasets by updating its parameters intelligently, continuously. After validating the model with the historical data, a prediction of no. of cases for 30 days was given for the five badly affected Indian states at that time.
Gurucharan et al. 4 worked to predict kidney disease for the clinical data using classification techniques. The causes and effect of disease after the period, from old data, will be predicted using efficient classification techniques. Ivorra et al. 5 proposed a new statistical model to understand the spread of this deadly disease. It is called the θ-SEIHRD model which used the known special characteristics of the disease -the presence of infectious cases which go/went undetected and the different health conditions of hospitalized people. Particularly, this model considers the fraction θ of detected cases over the total actual infected cases. In this way, the significance, this ratio has on COVID-19, is studied.
Kavadi et al. 6 proposed a Partial Derivative Regression (PDR) and Nonlinear Machine Learning (NML) method for prediction. To identify the best parameters in the dataset in an efficient manner computationally, PDR was used. Later, to make accurate predictions, NML was applied to the normalized features. According to the authors, the proposed meth-ods performed way better than the traditional ML methods.
Poonia and Azad 7 used two models -Holt's second-order exponential smoothing and Auto-Regressive Integrated Moving Average (ARIMA) to do 10-day forecasts of the pandemic in India. Based on the predictions, the authors have also made a few recommendations on the extension of lockdown in different states and is based on the zone in which they fall -red (extremely affected), blue (moderately affected) and green (least affected).
Rath et al. 8 used various regression models such as Linear Regression and Multiple Linear Regression to visualize and to predict the trend of cases for the next few days for the state of Odisha and India. According to the authors, both models showed a very high correlation score. The relationship between the dependent (active) and the independent (positive, recovered and deceased) variables is determined by a strong correlation score.
Rustam et al. 9 10 developed a model which takes into account the interaction of the following mutually exclusive subclasses: Susceptible, Lockdown, Exposed, Asymptomatic, Symptomatic, Hospitalized, and Recovered. Models with and without lockdown were used to emphasize that in places where there is a higher percentage of symptomatic infections, lockdown would be effective.
Sarkar et al. 11 proposed a new dynamic model to predict the dynamics of the pandemic in India. The model takes into account six types of individuals, namely Susceptible, Asymptomatic, Recovered, Infected, Isolated Infected (I q ) and Quarantined Susceptible (S q ), and is known as SARIIqSq. The results suggested that quarantining the susceptible individuals will, firstly, reduce the contact between infected and uninfected ones and, secondly, effectively reduce the basic reproduction number. Sujatha et al. 12 proposed a method that compared 3 models -Linear Regression (LR), Multilayer perceptron (MLP) and Vector Auto Regression (VAR) on data taken from Kaggle and implemented using WEKA and Orange. For each model, the predicted number of cases was compared with John Hopkins University (JHU) data. Based on this, the authors concluded that the MLP model performed better than the LR and VAR models.
Tomar and Gupta et al. 13 used methods such as Curve fitting and LSTM to predict the number of COVID-19 cases in India for 30 days. The authors also analyzed various measures like lockdown and social isolation and said that by following these measures, the transmission of the disease can be reduced significantly.
Yang et al. 14 made use of a modified SEIR model to model the spread of COVID-19 in China. The LSTM time series model, which was trained on the 2003 SARS (Severe Acute Respiratory Syndrome) outbreak data, was used to study the transmission trend and to predict the transmission of COV-ID-19. They found the model helped predict the sizes and peaks of the pandemic.

Data
Data was taken from https://www.covid19india.org/, 15 a crowd sourced initiative to collect, prepare and maintain the dashboard for all the States and Union Territories of India. It contains district-level data for confirmed cases, recovered cases, active cases and deceased cases and testing data on a state level. The data is updated multiple times a day to make sure that the dashboard is up-to-date.
The data for the two states was taken from the 10 th of April 2020 till the 9 th of September 2020 using their API. It was then cleaned, preprocessed and converted to a format for convenient use.

Procedure
After experimenting with various algorithms such as Linear Regression, Support Vector Machine Regression and Random Forest Regression, it was found that Random Forest Regression produced better results when compared to the other algorithms. Random Forests 16 is an ensemble machine learning technique. In ensemble methods, a sample of decision trees is taken and features to be used are calculated at each split and those results are aggregated to arrive at a prediction. The Random Forest Regressor model was used for the prediction. It is a supervised learning algorithm that uses an ensemble learning method called bagging for regression. 17 Consider a training set X containing n samples x1, x2, ..., xn with n responses Y=y1,y2,...,yn. Bagging happens B times and each time a random sample is selected with replacement from the training set and fit into these samples. Predictions for new (unseen) samples x' can be made either by taking the average of all regression trees generated individually on x' or by doing a majority vote in classification problems shown in equation 1. 16 ( ) In the bagging technique, many different decision trees are made. Each tree is made on different subsets of training data. Classification and Regression Trees (CART) are used for this purpose. They are unpruned and hence there would a slight overfit of the training data. Each tree is different and predictions are less correlated, which means the prediction errors would below. 18

Forecasting cases state-wise
The model was trained on the data from the 10 th of April 2020 till the 15 th of August 2020. It was tested on the data from the 16 th of August 2020 till the 9 th of September 2020.
The results for Tamil Nadu are as shown in Table 1. Visualizing the data The Test Positivity Rate (TPR) was evaluated for both states and the results are as shown in Figure 1. Initially, the rate was low for Maharashtra and it continued increasing to as high as 20%. Then there are signs of it flattening. Whereas for Tamil Nadu, it was high in the beginning and it slowly started to drop. Then it increased and currently saturated at around 10% for the past month or so. Figure 2 shows a plot of the cumulative cases was made to observe the increasing trend of the curve.  As one can observe, the exponential growth continues for Maharashtra while towards the end, the graph is almost linear in the case of Tamil Nadu. A graph of the daily cases is shown in Figure 3. In the case of Maharashtra, the general trend seems to be an increasing number of cases daily with the number dipping occasionally due to low testing. Figure  4 shows the comparison of daily testing data of both states. The low testing number on certain days corresponds to the dips in the daily cases numbers for Maharashtra. Tamil Nadu does more tests than Maharashtra on most of the days but still reports fewer cases. This shows the extent of spread in more in Maharashtra. But overall, both states show an increasing trend in daily testing numbers which is a positive trend. Figure 5 shows the cumulative testing numbers of both states. Figure 6 and 7 show the daily trends -Confirmed, Recovered and Deceased cases in both the states.

DISCUSSION
The Absolute Mean Error observed for Tamil Nadu was found to be 1.87% and that of Maharashtra to be 22.7%. It can be interpreted that the case growth rate was steady overall in Tamil Nadu while Maharashtra showed drastic variations in their testing numbers as well as in the positive cases. 15,16 As seen in Figure 1, we can see the Test Positivity Rate in Tamil Nadu initially increased and saturated and has remained almost constant throughout which the forecasts also show. For Maharashtra, the peak kept moving up until rates hit almost 20% before it started reducing. The sudden fluctuations in the rates in Maharashtra many times is the reason for a large error and deviation in the forecast.

CONCLUSION
Forecasting helps to a certain extent in determining the probable number of cases provided the growth rate or slowdown rate doesn't change rapidly. Better results can be obtained using Machine Learning techniques if there is district wise testing data. It helps to identify the "hotspot" districts by monitoring the test positivity rate continuously. As of now, we need to be extremely vigil and safe in this crucial situation by social distancing, wearing masks and follow personal hygiene practices to prevent transmission. Currently, the comparison was made only for two states. Extending the same to other states would help to distinguish and analyze how each state has fared. Also, the forecasting is being done with the help of daily testing data state-wise. The accuracy of the forecasts could be improved if further details like district wise testing data and the number of ICU beds occupied, vacant beds, etc. are released by the governments.

Source of Funding: Nil
Authors Contribution: All the authors have contributed to the research work.