DEV Community

loading...
Cover image for Project: COVID 19. 😷

Project: COVID 19. 😷

rakshakannu profile image Raksha Kannusami ・2 min read

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!💖

Discussion

pic
Editor guide
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 Author

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

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 Author

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

Thread Thread
muhimen123 profile image
Muhimen

You are most welcome. 😁

Collapse
lukaszahradnik profile image
Lukáš Zahradník

Those features of your data are very general and you are basically predicting if someone is ill - not necessarily covid19

Collapse
rakshakannu profile image
Raksha Kannusami Author

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
lukaszahradnik profile image
Lukáš Zahradník

They won't, because those are symptoms of every other disease and you cannot distinguish it.

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 Author

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 Author

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
kvanrooyen profile image
Keagan Van Rooyen

Looks good! Have you tested this on mobile yet?

Collapse
rakshakannu profile image
Raksha Kannusami Author

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 Author

Great! I will keep this in mind!

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 Author

Thank you Brittany!

Collapse
kushalvala profile image
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 Author

Thank you so much, Vaibhav! 😊

Collapse
flamingphoenix777 profile image
FlamingPhoenix777

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

Collapse
rakshakannu profile image
Raksha Kannusami Author

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

Collapse
flamingphoenix777 profile image
FlamingPhoenix777

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

Thanks anyway 👍👍

Thread Thread
rakshakannu profile image
Raksha Kannusami Author

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
Collapse
thevediwho profile image
Vaibhav Dwivedi

Great project. How accurate can you say it is?

Collapse
rakshakannu profile image
Raksha Kannusami Author

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
Collapse
chakrihacker profile image
Subramanya Chakravarthy

Awesome looks pretty dope

Collapse
rakshakannu profile image
Collapse
detzam profile image
webstuff

Get in contact with sone medical doctors

Collapse
rakshakannu profile image
Raksha Kannusami Author

Yes! Thanks for the suggestion!