DEV Community

Cover image for Project: COVID 19. 😷
Raksha Kannusami
Raksha Kannusami

Posted on

Project: COVID 19. 😷

Disclaimer:

Built this project after taking inspiration from a lot of projects that I saw on youtube based on COVID19. I'm glad I completed this project. Even though I did not know all the tech used, I learned all of it in the process of making this project.😊

📝Aim of the Project:

Build an application to combine my ML + web development skills. Create a Web application to predict the patient's probability of the contract of COVID19 based on the given symptoms.

👩🏻‍💻Technologies and Languages Used:

Python libraries - pandas, NumPy, Sklearn, pickle;
Jupyter Notebook,
Flask,
HTML,Bootstrap,
and Visual Studio Code.

📄Dataset:

Generated a dataset that contains 6 columns, where 5 columns are namely age(1-100), Body temperature in Fahrenheit(98-104), Body pain(0/1), Cough(1/0), Difficulty in breathing(-1/0/1) and the 6th column tells if the person has the disease or not(0/1).

📊Training the dataset:

I trained it using logistic regression and predicted the probability. Logistic regression is a statistical model that in its basic form uses a logistic function to model a binary dependent variable, although many more complex extensions exist. In regression analysis, logistic regression (or logit regression) is estimating the parameters of a logistic model (a form of binary regression).

You can see how I used the logistic regression on the dataset here.

📈Saving the model:

Used the python pickle library to save the model. The pickle module implements a fundamental, but powerful algorithm for serializing and de-serializing a Python object structure. “Pickling” is the process whereby a Python object hierarchy is converted into a byte stream, and “unpickling” is the inverse operation, whereby a byte stream is converted back into an object hierarchy. Pickling (and unpickling) is alternatively known as “serialization” or “flattening”, however, to avoid confusion, the terms used here are “pickling” and “unpickling”.

🌸Creating the UI:

Used simple HTML and Bootstrap to create the UI. Used basic elements like navbar, forms, and buttons. You can check the screenshots of the App below.

Alt Text

👾Putting it all together:

Now the only thing left is to combine everything using the Flask web framework. Flask is a micro web framework written in Python. It is classified as a microframework because it does not require particular tools or libraries.

You can understand how I did it here.

📟Live Demo & Source code:

Source code can be viewed at the GitHub repository given below. 🎉

GitHub logo rakshakannu / COVID19

A flask web app that can predict the probability of a patient contracting COVID19.

Live demo of the project is shown below.

Do check it out and provide feedback. Thank you!💖

Top comments (36)

Collapse
 
muhimen123 profile image
Muhimen

This project is so good than the plain simple covid 19 tracker. Excellent work!

Collapse
 
rakshakannu profile image
Raksha Kannusami

Thank you. Looking forward to implement it with a real world dataset and deploy it properly. Will be updating once it's done. :)

Collapse
 
muhimen123 profile image
Muhimen • Edited

In that case, ask any of your local hospitals or healthcares if they can provide with some data. That will be EPIC!

Thread Thread
 
rakshakannu profile image
Raksha Kannusami

Yes! Will take that step! and keep you updated! Thank you!

Thread Thread
 
muhimen123 profile image
Muhimen

You are most welcome. 😁

Collapse
 
kvanrooyen profile image
Keagan Van Rooyen

Looks good! Have you tested this on mobile yet?

Collapse
 
rakshakannu profile image
Raksha Kannusami

I haven't deployed it yet! I'm looking forward to deployed it soon. Once I do it, I will update this article. :))

Collapse
 
kvanrooyen profile image
Keagan Van Rooyen

Awesome! A quick and easy way to test on other devices (e.g. mobile) is to start the dev server, like you did in the video. After it has started, copy the URL into another device. I'm busy updating my website, and have been doing that to test how well it scales.

Thread Thread
 
rakshakannu profile image
Raksha Kannusami

Great! I will keep this in mind!

Collapse
 
amlana24 profile image
amlan

Looks great..all the best for completion..where did you get the training dataset from.

Collapse
 
rakshakannu profile image
Raksha Kannusami

Since I didn't get a dataset, I made one roughly to train the model. If we use a real dataset, we will get more realistic results!

Collapse
 
amlana24 profile image
amlan

Ok got it..I ask because I was planning something similar but couldnt find any dataset so just chucked the idea. But its good that you were able to fabricate data.

Thread Thread
 
rakshakannu profile image
Raksha Kannusami

Yes, the best way is to develop the project even though you don't get the realistic dataset. You can propose your project for realistic use, which again is a great thing.

Collapse
 
rakshakannu profile image
Raksha Kannusami

The symptoms I have chosen are the symptoms of covid19 as suggested by WHO. But again this dataset was created by me and is not real. The results will be realistic if the model is trained with real data set! :))

Collapse
 
sincerelybrittany profile image
Brittany

This is great! I hope to build something like this soon. Very nice work! ☺️

Collapse
 
rakshakannu profile image
Raksha Kannusami

Thank you Brittany!

Collapse
 
thevediwho profile image
Vaibhav Dwivedi

Great project. How accurate can you say it is?

Collapse
 
rakshakannu profile image
Raksha Kannusami

I have used a dataset that I created. It will be more accurate if I can get a realistic dataset which I did not get after searching all over Kaggle/ other websites!

Collapse
 
thevediwho profile image
Vaibhav Dwivedi

Hmm, Finding specific data would be difficult. Anyhow, great attempt!

Thread Thread
 
rakshakannu profile image
Raksha Kannusami

Thank you!

Collapse
 
kushal_ profile image
Kushal

Great work @rakshakannu !

Collapse
 
vaibhavkhulbe profile image
Vaibhav Khulbe

Good work! That's a nice, simple and straightforward predictor. Good to know that you learnt something new along the way. Keep going 💯 🔥

Collapse
 
rakshakannu profile image
Raksha Kannusami

Thank you so much, Vaibhav! 😊

Collapse
 
swagwik profile image
Sattwik Sahu

🤩🤩🤩🤩🤩🤩
Awesome! Where did you get the dataset tho? I couldn't find one anywhere

Collapse
 
rakshakannu profile image
Raksha Kannusami

I made a sample dataset and used it since I couldn't find one!!

Collapse
 
swagwik profile image
Sattwik Sahu

That's even more difficult then 😅 Maybe I can't do this after all 🙁🙁

Thanks anyway 👍👍

Thread Thread
 
rakshakannu profile image
Raksha Kannusami

Nothing is difficult when you try! :))

Collapse
 
afriiizal profile image
afriizal

Look good! I hope to build like this soon

Collapse
 
devanghingu profile image
Devang Hingu

Looking good 🤩🤩🤩

Collapse
 
rakshakannu profile image
Raksha Kannusami

Thank you!

Collapse
 
chakrihacker profile image
Subramanya Chakravarthy

Awesome looks pretty dope

Collapse
 
rakshakannu profile image
Raksha Kannusami

Thank you!

Collapse
 
detzam profile image
webstuff

Get in contact with sone medical doctors

Collapse
 
rakshakannu profile image
Raksha Kannusami

Yes! Thanks for the suggestion!