COVID 19 STUDY OF STATE OF KARNATAKA USING DATA SCIENCE as on 08-05-2020




We now study the COVID crisis in the State of Karnataka where the Pandemic seems to be under control as of 08-05-2020. if not than getting any worse.
We first load the dataset for the State of Karnataka 
is_subset1_Karnataka=subset1.STUT == "Karnataka"
subset1[is_subset1_Karnataka]
Karnataka began reporting from 09/03/2020 up to 08/05/2020 is shown here. Total 61 rows and 5 columns
dfKarnataka = subset1[is_subset1_Karnataka]
print(dfKarnataka)

The following Code gives the linear regression line output

X = dfKarnataka.drop('Confirmed',axis = 1)
y = dfKarnataka[['Confirmed']]
seed = 10
test_data_size = 0.3 
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = test_data_size, random_state = seed) 
train_data = pd.concat([X_train, y_train], axis = 1
test_data = pd.concat([X_test, y_test], axis = 1
fig, ax = plt.subplots(figsize=(126))
sns.regplot(x='Confirmed', y='Cured', ci=None, data=train_data, ax=ax, color='k', scatter_kws={"s"20,"color":"royalblue""alpha":1})
The blue points are initikally above the Regression line which then go below the line till about 590 confirmed cases the Cured cases go
upwards aboove the line indicating the number of Cured cases for State of Karnataka was rising against confirmed cases.
Let plot the log graph for this data for which the codes are as follows
fig, ax = plt.subplots(figsize=(126)) 
y = np.log(train_data['Confirmed'])
sns.regplot(x='Cured', y=y, ci=95, data=train_data, ax=ax, color='k', scatter_kws={"s"10,"color""royalblue""alpha":1})
ax.set_ylabel('log of Confirmed', fontsize=15,fontname='DejaVu Sans'
ax.set_xlabel("Cured",fontsize=15, fontname='DejaVu Sans'
ax.set_xlim(left=None, right=None
ax.set_ylim(bottom=None, top=None
ax.tick_params(axis='both', which='major', labelsize=12
fig.tight_layout()
The log graphshows that the Cured cases are rising with the number of confirmed cases.
Now lets see the Regression plot of Confirmed Vs Deaths we use the following code
X = dfKarnataka.drop('Confirmed',axis = 1)
y = dfKarnataka[['Confirmed']]
seed = 10
test_data_size = 0.3 
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = test_data_size, random_state = seed) 
train_data = pd.concat([X_train, y_train], axis = 1
test_data = pd.concat([X_test, y_test], axis = 1
fig, ax = plt.subplots(figsize=(126))
sns.regplot(x='Confirmed', y='Deaths', ci=None, data=train_data, ax=ax, color='k', scatter_kws={"s"20,"color":"royalblue""alpha":1})
We can see from the above graph that the number of deaths initially were less but towards the 680 confirmed cases it has increased.
fig, ax = plt.subplots(figsize=(126)) 
y = np.log(train_data['Confirmed'])
sns.regplot(x='Cured', y=y, ci=95, data=train_data, ax=ax, color='k', scatter_kws={"s"10,"color""royalblue""alpha":1})
ax.set_ylabel('log of Confirmed', fontsize=15,fontname='DejaVu Sans'
ax.set_xlabel("Deaths",fontsize=15, fontname='DejaVu Sans'
ax.set_xlim(left=None, right=None
ax.set_ylim(bottom=None, top=None
ax.tick_params(axis='both', which='major', labelsize=12
fig.tight_layout()
We can get a cleaer picture of the DeathsCases steadily dropping against the number of confirmed cases.
Now we obtain the heatmap for the correlation for the data for the State of Karnataka
corrMatrix = train_data.corr(method = 'pearson'
xnames=list(train_data.columns) 
ynames=list(train_data.columns) 
plot_corr(corrMatrix, xnames=xnames, ynames=ynames,title=None,normcolor=False, cmap='RdYlBu_r')
train_data.corr (method = 'pearson')


Overall the State of Karnataka is coming out of the COVID crisis as seen from the above plots. The number of confimred
cases have been dropping and the number of cured has increased.





Comments