Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/anty-filidor/covidout
Graph model of disease spreading
https://github.com/anty-filidor/covidout
covid-19 epidemic-simulations experiment mobility python
Last synced: 29 days ago
JSON representation
Graph model of disease spreading
- Host: GitHub
- URL: https://github.com/anty-filidor/covidout
- Owner: anty-filidor
- Created: 2020-03-21T12:15:54.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T03:51:26.000Z (about 2 years ago)
- Last Synced: 2024-11-08T18:47:21.182Z (3 months ago)
- Topics: covid-19, epidemic-simulations, experiment, mobility, python
- Language: Jupyter Notebook
- Homepage:
- Size: 15.7 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# 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](https://anty-filidor.github.io/covidout/#)### 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](spreading_model/networks/experiment.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](docs/aux/example.png) ![intprob](docs/aux/internal_prob.png)
Weight of interactions between nodes is given as:
![example](docs/aux/p_x.png)
Thus:
![example](docs/aux/p_a_desc.png)
![example](docs/aux/p_a.png)