1 Star 0 Fork 0

al0014 / covid19-sir

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
README.md 3.43 KB
一键复制 编辑 原始数据 按行查看 历史
Lisphilar 提交于 2020-05-15 01:50 . add: read country dataset

COVID-19 data with SIR model GitHub licensePython version

This is a package for COVID-19 data analysis with SIR-derived models. Please refer to COVID-19 data with SIR model notebook in Kaggle to understand the methods of analysis.

Introduction

With this Python package we can apply SIR-F model to COVID-19 data. SIR-F is a customized ODE model derived from SIR model. To evaluate the effect of measures, parameter estimation of SIR-F will be applied to subsets of time series data in each country. Parameter change points will be determined by S-R trend analysis. The details are explained in COVID-19 data with SIR model in Kaggle.

Recomended datasets

The datasets can be download using Kaggle API key and Kaggle package. Please read How to Use Kaggle: Public API and my Bash code input.sh in this repository.

The number of cases

Primary source: COVID-19 Data Repository by CSSE at Johns Hopkins University
Secondary source: Novel Corona Virus 2019 Dataset by SRK

Total population

covid19 global forecasting: locations population by Dmitry A. Grechka

The number of cases in Japan

Primary source: Ministry of Health, Labour and Welefare HP (in English)
Secondary source: Secondary source: COVID-19 dataset in Japan by Lisphilar

Installation

When you use this package in Kaggle notebook (need to turn on Internet option in notebook settings) or local environment with Pip,

pip install git+https://github.com/lisphilar/covid19-sir#egg=covsirphy

With Pipenv environment,

pipenv install git+https://github.com/lisphilar/covid19-sir#egg=covsirphy

For developers,

git clone https://github.com/lisphilar/covid19-sir.git
pipenv install --dev

Quick usage

Import this package.

import covsirphy as cs
from covsirphy import JHUData, Population

Perform data cleaning of JHU dataset.

# With CSV filepath of JHU dataset
jhu_data = JHUData("input/covid_19_data.csv")
jhu_data.cleaned()

We can import dataset for one country.

# As an example, read Japan dataset
jpn_data = CountryData("input/covid_jpn_total.csv", country="Japan")
jpn_data.set_variables(
    date="Date",
    confirmed="Positive",
    fatal="Fatal",
    recovered="Discharged",
    province=None
)
jpn_data.cleaned()

Perform data cleaning of population dataset.

# With CSV filepath of population dataset
pop = Population("input/locations_population.csv")
pop_dict = pop.to_dict(country_level=True)

(Please see the Kaggle notebook, update later)

Citation

Lisphilar, 2020, Kaggle notebook, COVID-19 data with SIR model, https://www.kaggle.com/lisphilar/covid-19-data-with-sir-model

Lisphilar, 2020, GitHub repository, Covsirphy, Python package for COVID-19 data with SIR model, https://github.com/lisphilar/covid19-sir

1
https://gitee.com/al0014/covid19-sir.git
git@gitee.com:al0014/covid19-sir.git
al0014
covid19-sir
covid19-sir
master

搜索帮助