Classification of COVID-19 victims using Machine Learning Models.

Introduction(Need of the hour)

Akshay Hegde
Analytics Vidhya
5 min readAug 28, 2020

--

Mostly Machine Learning has found its application in Medical Field, Automation cracking the Number crunching Algorithms etc.

COVID-19 is one of the most dark era humanity has ever faced,it has totally endeavored the year 2020 and leaving behind a dark spot for our future generations.

Researchers,scholars and professionals in their respective fields are making ends meet to get us out of this pandemic situation.

It’s time we contribute to their work within our respective fields of expertise.This blog is about the classification of COVID victims as either mild,serious or critical.Based on this we can suggest whether patients can be put into quarantine, hospitals or under ventilators,It is just a naive approach towards solving the problem, it can be taken to next level for with critical thinking and making use of sophisticated algorithms.

About the Dataset

The dataset is taken from Kaggle and it contains many attributes which are essential for building the model, it also contains the medical history of a particular patient, blood samples, diabetes, diseases etc.

The dataset is huge and contains both floating point data and categorical data.

Key Observations

  1. The key observation here is the dataset is sparse as a whole and doesn’t have all the required data under a particular field, some data is missing as the samples were not collected or aren’t available for that field.
  2. All the attributes in the dataset don’t contribute significantly to the Machine Learning Model we are going to build.
  3. Imputing categorical features may lead to spurious tuples which doesn’t make sense.So we are ignoring categorical features in our Dataset.

These are the few images of the dataset

This is just a sample view of the datasets.

As we can see there are many values which are unknown or Nan values so we have to fill the holes before applying the model.

How to Impute the Dataset ?

Let’s just explore the conventional methods first before jumping to our Idea.

  1. To simply ignore the column — But that can’t be done in this case since this is a sparse dataset after the deletion we would be left with only a handful of attributes and significant attributes maybe lost.
  2. To impute with central Tendency —In traditional Machine Learning Models we use to impute the NaN values with mean of the entire column, since every column is sparse it is difficult to find the mean as the mean found would not be near to the actual mean because of too many missing values.

So in such cases we have to think out of the box as desperate time needs desperate measures.

We train a model to first predict the missing values but which is not simple either as we have to have the expertise over the domain and also on the stats.

But this is to show the application of Multiple Linear Regression in discarding the insignificant attributes.

The way Imputation has been performed on the dataset is:

  1. Neglecting the categorical data for the first phase of classification, as imputing them would make no sense because of their binary “YES” or “NO” property.
  2. Imputing the real values with suitable measures of central Tendency.

How the Machine Learning Model is Applied?

Once we Impute the dataset now we need to eliminate insignificant attributes from the dataset using Backward Elimination(Multiple Linear Regression).

The concept of backward Elimination is explained in detail in my previous blog, this is just the continuation of the previous blog.

Once the above procedures are done now its a downhill from here to apply various classification Models.

The models that gave the best results were

  1. Support Vector Machine(90.8%)
  2. Decision Tree Classifier(89.54%)

I made use of Confusion Matrix to visualize how the output is scattered across various class.

The code can be seen below

The above is the exact code I have used for classification if somebody needs the dataset they can message me.

Future Scope

The model can be made further sophisticated both in terms of its Application and also its Accuracy.

  1. We can make use of the categorical variables which we had neglected in order to increase the accuracy.
  2. We can tune the parameters using k-fold cross validation, Gradient Boosting ,Ensemble learning etc.

The rest is left to you to come up with brainstorming ideas to tackle this situation.

--

--