GithubHelp home page GithubHelp logo

anty-filidor / covidout Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 16.06 MB

Graph model of disease spreading

Python 0.66% Jupyter Notebook 99.30% Makefile 0.02% Batchfile 0.02%
covid-19 epidemic-simulations python mobility experiment

covidout's Introduction

COVID OUT!

This repository contains a implementation of graph informational spreading model which simulates an illness propagation. Data is being generated in silulation of interactions between people. Internal states of people are being described by significant symptoms of CoVid19 ilness. This model has been developed after medical consultations and it is an entry for machine learning pipeline (after feeding with real data).

DOCUMENTATION IS HERE

Structure of repository

├── data_generation
│   ├── databases.example.json
│   ├── fill_database.py
│   ├── gen_database.py
│   ├── gen_graphs.py
│   ├── graphs
│   ├── names
│   ├── simulation.py
│   └── visualize_movement_simulation.py
├── docs
├── readme.md
├── requirements.txt
└── spreading_model
├── ioops.py
├── networks
├── spreading.py
├── src.ipynb
└── visualisations.py

How to run this code

Data generation

Algorithms to simulate human population inside city. There are 3 scripts to be run:

  • gen_database.py: It generates database files in csv format
  • fil_database.py: It fills main sql database with generated data. Please use databases.json file to enter credentials. There is databases.example.json for reference
  • gen_graphs.py: It generates data for graph analisis.

Also this framework contains all the classes to parse info in database for further analysis

Spreading model

Please use src.ipynb notebook to perform an experiment. It contains

  • read of network
  • experiment
  • saving results as json of internal states of nodes or gif:

gif

Model is based on an observation, that its hard to distinguish between common flu and coronavirus. So instead of trying to predict coronavirus, we are tracking spread of any flu (ie. we create probabilistic chain of infections - who infected who). Then if one person from such a network is somehow diagnosed with coronaviurs, we can use this information to spread risks through is "flu symptoms" network.

To build graph structure, we are using information from the GPS / location services. Connection weights are based on time that 2 people spent in near proximity. Then to calculate risks, we use a conditional probabilities of coronavirus conditioned by symptoms (see ioops.py_comp_internal_weights) that user provided in the app and facts / probabilities of coronavirus being diagnosed in his network.

To sum up, model consists of 2 components:

  • internal probability of being infected by each neighbour node. This function is a sigmoid of 13 different medical symptoms (see ioops.py_comp_internal_weights)
  • external probability of illness transfer by interpersonal contact. It is stored in edges of graph model. From hat coefficients a resultant probability is being computed by using conditional probability laws.

Example

Let's assume following network, internal probability of being ill in node can be:

example intprob

Weight of interactions between nodes is given as:

example

Thus:

example example

covidout's People

Contributors

mipo57 avatar anty-filidor avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.