The purpose of this model is to estimate the duration and the total number of cases of the COVID-19 spread by country.
The model reads data from the data repository for the 2019 Novel Coronavirus Visual Dashboard operated by the Johns Hopkins University Center for Systems Science and Engineering (JHU CSSE)
- Clone the repo to your local machine and install the package:
# go to the repo directory and run from the terminal:
pip install -e .
- Import the functions:
# in Python
from data import corona.read_covid_cases
from models import corona.LogisticCurve
- Download data for a specific country:
df = read_covid_cases(countries=["ITALY"])
- Fit the Logistic Growth Model
# select "confirmed" to predict cases or "deaths" for fatalities
y = df["confirmed"].values
lc = LogisticCurve()
lc.fit(y)
- Run predictions
y_pred, (y_pred_upper, y_pred_lower) = lc.predict(y)
- Plot results
lc.plot(y)