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.
👾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. 🎉
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 (34)
This project is so good than the plain simple covid 19 tracker. Excellent work!
Thank you. Looking forward to implement it with a real world dataset and deploy it properly. Will be updating once it's done. :)
In that case, ask any of your local hospitals or healthcares if they can provide with some data. That will be EPIC!
Yes! Will take that step! and keep you updated! Thank you!
You are most welcome. 😁
Looks good! Have you tested this on mobile yet?
I haven't deployed it yet! I'm looking forward to deployed it soon. Once I do it, I will update this article. :))
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.
Great! I will keep this in mind!
Looks great..all the best for completion..where did you get the training dataset from.
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!
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.
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.
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! :))
This is great! I hope to build something like this soon. Very nice work! ☺️
Thank you Brittany!
Great project. How accurate can you say it is?
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!
Hmm, Finding specific data would be difficult. Anyhow, great attempt!
Thank you!
Great work @rakshakannu !
Good work! That's a nice, simple and straightforward predictor. Good to know that you learnt something new along the way. Keep going 💯 🔥
Thank you so much, Vaibhav! 😊
🤩🤩🤩🤩🤩🤩
Awesome! Where did you get the dataset tho? I couldn't find one anywhere
I made a sample dataset and used it since I couldn't find one!!
That's even more difficult then 😅 Maybe I can't do this after all 🙁🙁
Thanks anyway 👍👍
Nothing is difficult when you try! :))
Look good! I hope to build like this soon