Skip to content

JarnoRFB/epysurv

Repository files navigation

Binder Documentation Status Conda Installation Build Status codecov Language grade: Python Code style: black

epysurv

epysurv is a Pythonic wrapper around the R surveillance package that strives to implement a scikit-learn like API for epidemiological surveillance in Python.

In a nutshell

from epysurv import data as epidata
from epysurv.models.timepoint import FarringtonFlexible
train, test = epidata.salmonella()
train.head()
#             n_cases  n_outbreak_cases  outbreak
# 2004-01-05        0                 0     False
# 2004-01-12        0                 0     False
# 2004-01-19        2                 0     False
# 2004-01-26        2                 0     False
# 2004-02-02        1                 0     False    
model = FarringtonFlexible()
model.fit(train)
model.predict(test)
#             n_cases  n_outbreak_cases  outbreak  alarm
# 2011-01-03        1                 0     False    0.0
# 2011-01-10        0                 0     False    0.0
# 2011-01-17        3                 0     False    0.0
# 2011-01-24        3                 0     False    0.0
# 2011-01-31        3                 0     False    0.0

Installation

As epysurv requires both Python and R it can only be conveniently installed through conda:

conda install -c conda-forge epysurv 

Documentation

You can read the documentation or try an interactive demo on binder.

Development

To set up a local development environment, run

conda env create -f env.yml
conda activate epysurv-dev
pip install -r requirements-dev.txt
pre-commit install 

To run all tests, simply run

pytest

in the project's root directory.

If you want to contribute to the documentation, run

pip install -r requirements-doc.txt

to install the necessary packages for building the sphinx documentation.

Pull requests are highly welcome!

Related Projects