Skip to content

The purpose of this project is to estimate the duration and the total number of cases of the COVID-19 spread by country.

Notifications You must be signed in to change notification settings

pvilar/predict-covid-cases

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logistic Growth Model for estimating Corona Virus spread

The purpose of this model is to estimate the duration and the total number of cases of the COVID-19 spread by country.

Data source

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)

How to use

  1. Clone the repo to your local machine and install the package:
# go to the repo directory and run from the terminal:
pip install -e .
  1. Import the functions:
# in Python
from data import corona.read_covid_cases
from models import corona.LogisticCurve
  1. Download data for a specific country:
df = read_covid_cases(countries=["ITALY"])
  1. Fit the Logistic Growth Model
# select "confirmed" to predict cases or "deaths" for fatalities
y = df["confirmed"].values
lc = LogisticCurve()
lc.fit(y)
  1. Run predictions
y_pred, (y_pred_upper, y_pred_lower) = lc.predict(y)
  1. Plot results
lc.plot(y)

Output example

About

The purpose of this project is to estimate the duration and the total number of cases of the COVID-19 spread by country.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages