In this Project we analyses the spread and impact of the novel coronavirus pandemic which has taken the world by storm with its rapid growth. In this we like to develop a machine learning model in Python to analyze what has been its impact so far and analyze the outbreak of COVID 19 across various regions, visualize them using charts and tables, and predict the number of upcoming confirmed cases.
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
COVID-19 Outbreak Prediction Using Machine Learning
1. COVID-19 OUTBREAK PREDICTION USING MACHINE LEARNING
A PROJECTREPORT
Submitted by
NAVEEN REDDY.N(18BCE1036)
BHARATH SAI(18BCE1264)
BACHELOR OF ENGINEERING
in
COMPUTER SCIENCE ENGINEERING
VIT UNIVERSITY, CHENNAI
VIT UNIVERSITY: CHENNAI 600127
2. BONAFIDE CERTIFICATE
Certified that this project report “COVID-19 OUTBREAK PREDICTION USING
MACHINE LEARNING” is the bonafidework of K.BHARATH SAI(18BCE1264),
N.NAVEEN REDDY(18BCE1264) who carried out the project work under my
supervision.
SIGNATURE
Dr.ANUSOOYA.G
Schoolof Computer Science and Engineering
VITUniversity
Chennai – 600127
3. CONTENTS
ABSTRACT
INTRODUCTION
Tasks tobe performed
SOFTWARE/HARDWARE REQUIREMENTS
MODULES
IMPLEMENTATION WITH RESULTS AND DESCRIPTION
Analysing the present conditioninIndia
Is the trendsimilar toItaly/S.Korea/ Wuhan?
Exploring Worldwide data
Forecasting Total Number of Cases Worldwide
RESULT DISCUSSION WITH COMPARISON (IF APPLICABLE)
CONCLUSION
REFERENCE
4. ABSTRACT
Several outbreak prediction models for COVID-19 arebeing used by officials
around the world to make informed-decisions and enforcerelevant control
measures. Among the standard models for COVID-19 globalpandemic prediction,
simple epidemiological and statistical models have received moreattention by
authorities, and they are popular in the media. Dueto a high level of uncertainty
and lack of essential data, standard models haveshown low accuracy for long-
term prediction. Although the literature includes severalattempts to address this
issue, the essential generalization and robustness abilities of existing models
needs to be improved. This paper presents a comparativeanalysis of machine
learning and softcomputing models to predict the COVID-19outbreak as an
alternative to SIRand SEIRmodels. Among a wide range of machine learning
models investigated, two models showed promising results (i.e., multi-layered
perceptron, MLP, and adaptive network-based fuzzy inferencesystem, ANFIS).
Based on the results reported here, and due to the highly complex nature of the
COVID-19 outbreak and variation in its behavior fromnation-to-nation, this study
suggests machinelearning as an effective tool to model the outbreak. This paper
provides an initial benchmarking to demonstratethe potential of machine
learning for future research. Paper further suggests thatreal novelty in outbreak
prediction can be realized through integrating machine learning and SEIR models.
INTRODUCTION
Access to accurate outbreak prediction models is essential to obtain insights into
the likely spread and consequences of infectious diseases. Governments and
other legislative bodies rely on insights fromprediction models to suggest new
policies and to assess the effectiveness of the enforced policies. The novel Corona
virus disease(COVID-19) has been reported to infect more than 2 million people,
with more than 132,000confirmed deaths worldwide. Therecent global COVID-
19 pandemic has exhibited a nonlinear and complex nature. In addition, the
outbreak has differences with other recent outbreaks, which brings into question
the ability of standard models to deliver accurateresults. Besides the numerous
known and unknown variables involved in the spread, the complexity of
5. population-widebehavior in various geopolitical areas and differences in
containment strategies had dramatically increased model uncertainty .
Consequently, standard epidemiological models face new challenges to deliver
more reliable results. To overcomethis challenge, many novel models have
emerged which introduceseveral assumptions to modeling (e.g., adding social
distancing in the form of curfews, quarantines, etc.)
Tasks to be performed:
Analysing the present condition in India
Is this trend similar to Italy/S. Korea/ Wuhan
Exploring the world wide data
Forecasting the world wide COVID-19 cases using Prophet
SOFTWARE/HARDWARE REQUIREMENTS
GOOGLECOLABS
PYTHON
Prophet
MODULES
The modules are
(1) Search space definition module
Each country has a different trend and demands a neural network with different
parameter setup. The input data is fixed for all countries that contain three main
concerns for the risk categorization. Number of cases (κ), number of deaths (δ),
and number of recoveries (ρ). The number of active cases (α) is calculated by κ −
(ρ + δ).
6. (2) Network search module
The method selects the set of hyper-parameters thatperforms the best according
to the probability. First, individual COVID-19 trend is used to automatically design
the desired neural network. Next, the network optimized for an individual country
is used to predict the number of cases (κ), the number of deaths (δ), and the
number of recoveries (ρ). These data are used in the next module to decide the
risk of the country.
(3) Local trend prediction
This prediction introduces a new way to predict an epidemic outbreak and
correlate with the risk of a country.
(4) A fuzzy rule-based risk assessment module
The prediction of δ, κ, and ρ is used to predict the risk for the country. Wedefine
3 categories of risks (1) high risk (HR), (2) medium risk (MR), (3) recovering (RE).
First, we calculate the death rate, the rate of new cases, and the recovery rateas:
death rate = κ δ case rate = total population α recovery rate = α ρ
IMPLEMENTATION WITH RESULTS AND DESCRIPTION
Analysing COVID19 Cases in India
Visualization Inference:
Manipur and Mizoramreport their firstcase.
Kerela has crossed Maharashtra in terms of higher number of confirmed
cases.
Haryana and Telengana havethe highest count of confirmed foreign
national counts.
As of March 25, 9 people havedied in India
Kerala, Maharashtra and Karnataka arecurrently in the TOP 3 of the states
with the maximum number of confirmed cases
7. Visualising the spread geographically
Confirmed vs Recovered figures
How the Coronavirus cases arerising?
8. Trendof CoronavirusCases inIndia
Coronavirus Cases in India on daily basis
Is the trend similar to Italy/ S.Korea/ Wuhan?
India has already exceeded 562 cases. Itis very important to contain the situation
in the next 21 days, the number of coronavirus patients began to double after
these countries reached the 100 mark and almost began to increase
exponentially.
9. Cumulative cases in India, Italy, S.Korea, and Wuhan
ConfirmedCasesinIndia
ConfirmedCasesinWuhan
10. ConfirmedCasesinSouthKorea
ConfirmedCasesinItaly
VisualizationInference
Confirmed cases in India areincreasing exponentially without a fixed
pattern (very less testing in India)
Confirmed cases in Italy areincreasing exponentially with a certain fixed
pattern
Confirmed cases in South Korea are gradually increasing
Recent Updates from Wuhan
China on Tuesday decided to lift the three-month lockdown on more than
56 million people in central Hubei province.
Bus services began in Wuhan for the first time sinceJanuary 23 when a bus
departed fromits terminal at Hankou train station at 5:25 a.m. on
Wednesday.
The protracted lockdown of Hubei's capital Wuhan will end on April 8,
lifting the massivequarantine on the city with a population of more than 11
million.
Comparison between the rise of cases in Wuhan, S.Korea, Italy and India
11. Total CasesinS.Korea,Italy,India
Trend after crossing 100 cases
Graph after crossing 100 cases
Visualization Inference:
Abovegraph depicts the number of days after the COVID-19cases crosses
100 vs total number of cases in each country.
Both Italy and S.Korea havecrossed the mark of 5600 in the next 13 days.
Number of cases detected(trend) in India is less as compared to Italy and
S.Korea
12. Exploring World wide data
Visualizing: WorldwideNCOVID-19 cases
Worldwide Ncovid-19Cases
Forecasting Total Number of Cases Worldwide
Prophetis open sourcesoftwarereleased by Facebook's CoreData Science team.
Itis available for download at CRAN and PyPI.
We use Prophet, a procedurefor forecasting time series data based on an
additive model wherenon-linear trends are adjusted for annual, weekly and daily
seasonality, in addition to the effects of holidays. Works bestwith time series that
have strong seasonaleffects and multiple seasons of historicaldata. Prophet is
robustto missing data and changes in trend, and it typically handles outliers well.
Why Prophet?
Accurate andfast: Prophetis used in many applications on Facebook to produce
reliable forecasts for planning and goal setting. Facebook finds that it works
better than any other approach in most cases. Itfits the models in Stan so you get
forecasts in justseconds.
13. Fully Automatic - Get a reasonableforecaston messy data without manualeffort.
Prophetis resistantto outliers, missing data, and drastic changes in its time series.
Adjustable Forecasts - TheProphet procedureincludes many possibilities for
users to modify and adjustforecasts. You can use human interpretable
parameters to improve your forecastby adding your domain knowledge
Available inR or Python: Facebook has implemented the Prophet procedurein R
and Python. They both sharethe same Stan code behind for tuning. You can use
whatever language you are comfortable with for forecasting.
Forecasting Confirmed NCOVID-19 Cases Worldwidewith Prophet(Basemodel)
I can plot the forecastby calling the Prophet.plot method and passing in your
forecastdataframe.
Forecasting Confirmed NCOVID-19 Cases Worldwide with Prophet
14. Weekly Cases after Janta Curfew
What do you think was the reason behind calling Janta Curfew on 22nd March
and country lockdown from24th March till next 21 days?
PM Modi announced Janta Curfew in India on 22nd March. From24th March
there is a complete lockdown the entire country. Definatelyits for our own
good.
No scheduled international commercial flight's paasenger shall be allowed to
land in india fromMarch 22 for a week.
From24th midnight all the domestic and international flights havebeen
called off.
ForecastingWorldwideDeathsusingProphet(Base model)
17. WorldwideRecovered Cases
Inferencefrom the above Analysis and Forecast
Will Indian become the next Italy/S.Korea/ Wuhan?
Yes, if you look at the world's data and its forecastyou can say that India might
face one of its worstdays if weare not taking strict measures againstCOVID-19.
Today's Indian governmentdecision confirms that the aboveprediction is
definitely something we are paying attention to.
Please stay home / indoors for the 21 days. This will definitely help us address
the situation. It won'tstop the pandemic, but it would definitely help us
reduce the exponential rate at which it is increasing.
Let's help out in the fight againstthis pandemic by at least quarantining
ourselves by staying indoors and protecting you and your family.
RESULT DISCUSSION WITH COMPARISON(IF APPLICABLE)
Will Indian become the next Italy/S.Korea/ Wuhan?
Yes, if you look at the world's data and its forecastyou can say that India might
face one of its worstdays if weare not taking strict measures againstCOVID-19.
Today's Indian governmentdecision confirms that the aboveprediction is
definitely something we are paying attention to.
Please stay home / indoors for the 21 days. This will definitely help us address
the situation. It won'tstop the pandemic, but it would definitely help us
reduce the exponential rate at which it is increasing.
Let's help out in the fight againstthis pandemic by at least quarantining
ourselves by staying indoors and protecting you and your family.
Get a checkup in case you have a cough, cold, fever, shortness of breath, and
trouble breathing. I can't say for sure, but (due to lack of data), but we may
not have the exact number of COVID-19cases in India becausesometimes it
takes weeks to see the first sign / symptomof that.
18. CONCLUSION
The global pandemic of the severe acute respiratory syndromeCoronavirus2
(SARS-CoV-2) has becomethe primary national security issueof many nations.
Advancement of accurate prediction models for the outbreak is essential to
provideinsights into the spread and consequences of this infectious disease. Due
to the high level of uncertainty and lack of crucial data, standard epidemiological
models haveshown low accuracy for long-term prediction. This paper presents a
comparativeanalysis of ML and softcomputing models to predict the COVID-19
outbreak.
REFERENCE
https://spectrum.ieee.org/the-institute/ieee-covid19-resources
https://www.bbc.com/news/amp/world-asia-india-51922204
https://www.aljazeera.com/news/2020/03/18/indias-poor-testing-rate-may-
have-masked-coronavirus-cases/
https://facebook.github.io/prophet/docs/quick_start.html
https://facebook.github.io/prophet/docs/
https://github.com/facebook/prophet
Data Source:
https://www.mohfw.gov.in/
19. https://www.kaggle.com/sudalairajkumar/novel-corona-virus-2019-dataset
CODE:
Importing the required libraries
# importing the required libraries
import pandas as pd
# Visualisation libraries
import matplotlib.pyplot as plt
%matplotlib inline
import seaborn as sns
import plotly.express as px
import plotly.graph_objects as go
import folium
from folium import plugins
# Manipulating the default plot size
plt.rcParams['figure.figsize'] = 10, 12
# Disable warnings
import warnings
20. warnings.filterwarnings('ignore')
Analysing the present condition in India
# Reading the datasets
df= pd.read_excel('Copy of Covid cases in India.xlsx')
df_india = df.copy()
df
# Coordinates of India States and Union Territories
India_coord = pd.read_excel('Copy of Indian Coordinates.xlsx')
#Day by day data of India, Korea, Italy and Wuhan
dbd_India = pd.read_excel('Copy of per_day_cases.xlsx',parse_dat
es=True, sheet_name='India')
dbd_Italy = pd.read_excel('Copy of per_day_cases.xlsx',parse_dat
es=True, sheet_name="Italy")
dbd_Korea = pd.read_excel('Copy of per_day_cases.xlsx',parse_dat
es=True, sheet_name="Korea")
dbd_Wuhan = pd.read_excel('Copy of per_day_cases.xlsx',parse_dat
es=True, sheet_name="Wuhan")
Analysing COVID19 Cases in India
#Total case is the total number of confirmed cases (Indian Natio
nal + Foreign National)
df.drop(['S. No.'],axis=1,inplace=True)
df['Total cases'] = df['Total Confirmed cases (Indian National)'
] + df['Total Confirmed cases ( Foreign National )']
total_cases = df['Total cases'].sum()
print('Total number of confirmed COVID 2019 cases across India t
ill date (22nd March, 2020):', total_cases)
df.style.background_gradient(cmap='Reds')
Number of Active COVID-19 cases in affected State/Union Territories
#Total Active is the Total cases - (Number of death + Cured)
df['Total Active'] = df['Total cases'] -
(df['Death'] + df['Cured'])
total_active = df['Total Active'].sum()
print('Total number of active COVID 2019 cases across India:', t
otal_active)
21. Tot_Cases = df.groupby('Name of State / UT')['Total Active'].sum
().sort_values(ascending=False).to_frame()
Tot_Cases.style.background_gradient(cmap='Reds')
Visualising the spread geographically
df_full = pd.merge(India_coord,df,on='Name of State / UT')
map = folium.Map(location=[20, 70], zoom_start=4,tiles='Stamente
rrain')
for lat, lon, value, name in zip(df_full['Latitude'], df_full['L
ongitude'], df_full['Total cases'], df_full['Name of State / UT'
]):
folium.CircleMarker([lat, lon], radius=value*0.8, popup = ('
<strong>State</strong>: ' + str(name).capitalize() + '<br>''<str
ong>Total Cases</strong>: ' + str(value) + '<br>'),color='red',f
ill_color='red',fill_opacity=0.3 ).add_to(map)
map
Confirmed vs Recovered figures
f, ax = plt.subplots(figsize=(12, 8))
data = df_full[['Name of State / UT','Total cases','Cured','Deat
h']]
data.sort_values('Total cases',ascending=False,inplace=True)
sns.set_color_codes("pastel")
sns.barplot(x="Total cases", y="Name of State / UT", data=data,l
abel="Total", color="r")
sns.set_color_codes("muted")
sns.barplot(x="Cured", y="Name of State / UT", data=data, label=
"Cured", color="g")
# Add a legend and informative axis label
ax.legend(ncol=2, loc="lower right", frameon=True)
ax.set(xlim=(0, 35), ylabel="",xlabel="Cases")
sns.despine(left=True, bottom=True)
22. How the Coronavirus cases are rising?
#This cell's code is required when you are working with plotly o
n colab
import plotly
plotly.io.renderers.default = 'colab'
# import plotly.graph_objects as go
# Rise of COVID-19 cases in India
fig = go.Figure()
fig.add_trace(go.Scatter(x=dbd_India['Date'], y = dbd_India['Tot
al Cases'], mode='lines+markers',name='Total Cases'))
fig.update_layout(title_text='Trend of Coronavirus Cases in Indi
a (Cumulative cases)',plot_bgcolor='rgb(230, 230, 230)')
fig.show()
# New COVID-19 cases reported daily in India
import plotly.express as px
fig = px.bar(dbd_India, x="Date", y="New Cases", barmode='group'
, height=400)
fig.update_layout(title_text='Coronavirus Cases in India on dail
y basis',plot_bgcolor='rgb(230, 230, 230)')
fig.show()
Cumulative cases in India, Italy, S.Korea, and Wuhan
# import plotly.express as px
fig = px.bar(dbd_India, x="Date", y="Total Cases", color='Total
Cases', orientation='v', height=600,
title='Confirmed Cases in India', color_discrete_se
quence = px.colors.cyclical.IceFire)
'''Colour Scale for plotly
https://plot.ly/python/builtin-colorscales/
'''
fig.update_layout(plot_bgcolor='rgb(230, 230, 230)')
fig.show()
fig = px.bar(dbd_Italy, x="Date", y="Total Cases", color='Total
Cases', orientation='v', height=600,
title='Confirmed Cases in Italy', color_discrete_se
quence = px.colors.cyclical.IceFire)
fig.update_layout(plot_bgcolor='rgb(230, 230, 230)')
fig.show()
23. fig = px.bar(dbd_Korea, x="Date", y="Total Cases", color='Total
Cases', orientation='v', height=600,
title='Confirmed Cases in South Korea', color_discr
ete_sequence = px.colors.cyclical.IceFire)
fig.update_layout(plot_bgcolor='rgb(230, 230, 230)')
fig.show()
fig = px.bar(dbd_Wuhan, x="Date", y="Total Cases", color='Total
Cases', orientation='v', height=600,
title='Confirmed Cases in Wuhan', color_discrete_se
quence = px.colors.cyclical.IceFire)
fig.update_layout(plot_bgcolor='rgb(230, 230, 230)')
fig.show()
Comparison between the rise of cases in Wuhan, S.Korea, Italy and India
from plotly.subplots import make_subplots
fig = make_subplots(
rows=2, cols=2,
specs=[[{}, {}],
[{"colspan": 2}, None]],
subplot_titles=("S.Korea","Italy", "India","Wuhan"))
fig.add_trace(go.Bar(x=dbd_Korea['Date'], y=dbd_Korea['Total Cas
es'],
marker=dict(color=dbd_Korea['Total Cases'],
coloraxis="coloraxis")),1, 1)
fig.add_trace(go.Bar(x=dbd_Italy['Date'], y=dbd_Italy['Total Cas
es'],
marker=dict(color=dbd_Italy['Total Cases'],
coloraxis="coloraxis")),1, 2)
fig.add_trace(go.Bar(x=dbd_India['Date'], y=dbd_India['Total Cas
es'],
marker=dict(color=dbd_India['Total Cases'],
coloraxis="coloraxis")),2, 1)
fig.update_layout(coloraxis=dict(colorscale='Bluered_r'), showle
gend=False,title_text="Total Confirmed cases(Cumulative)")
fig.update_layout(plot_bgcolor='rgb(230, 230, 230)')
fig.show()