We make SIR model with python from COVID-19 Italy dataset.
Use the package manager pip to install required packages.
pip install numpy
pip install matplotlib
pip install scipy
pip install beautifulsoup4
pip install requests
Python version used :
python --version
Python 3.6.8
There are 3 main file in the root directory.
- Scrapper
scrapper.py
Is used to download automatically the data from the github. Here is the github link - Cleaner
cleaner.py
Is used to clean the downloaded data and save the new data indataset/dataframe.csv
- Runner
runner.py
Is used to run the SIR model and compare it to thedataset/dataframe.csv
so that we can get the accuracy of the model.
First, thing first. Install all the requirement. And then, run the scrapper.py
like this :
python scrapper.py
Wait untill all the data is downloaded into the ./dataset/
folder. After that, the second thing we must do is clean the data :
python cleaner.py
After the data has been cleaned. We can continue to run the runner file :
python runner.py
We can see in stdout about the details. And also, remember that the value of constant.TIME must be equal to the number of row in dataframe. Unless you dont want to plot the real data result.
There are two models that we provide :
- SIR (Susceptible, Infected, Recovered/Removed)
- SEIRD (Susceptible, Exposed, Infected, Recovered, Death)
You can find both model file python in ./model/
directory
No contributor needed
- https://www.statista.com/statistics/270473/age-distribution-in-italy/
- https://www.statista.com/statistics/1106372/coronavirus-death-rate-by-age-group-italy/
- https://www.worldometers.info/coronavirus/coronavirus-incubation-period/
- https://scipython.com/book/chapter-8-scipy/additional-examples/the-sir-epidemic-model/
- https://towardsdatascience.com/infectious-disease-modelling-beyond-the-basic-sir-model-216369c584c4
- https://en.wikipedia.org/wiki/Basic_reproduction_number