Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Code and real data for "Counterfactual Temporal Point Processes", NeurIPS 2022

License

NotificationsYou must be signed in to change notification settings

Networks-Learning/counterfactual-tpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

90 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a repository containing code and real data for the paperCounterfactual Temporal Point Processes, published at NeurIPS 2022.

Pre-requisites

This code depends on the following packages:

  1. networkx
  2. numpy
  3. pandas
  4. matplotlib

to generate map plots:

  1. GeoPandas
  2. geoplot

In order to install the project dependencies you can run the following command:

pip install -r requirements.txt

Code structure

  • src/counterfactual_tpp.py: Contains the code to sample rejected events using the superposition property and the algorithm to calculate the counterfactuals.
  • src/gumbel.py: Contains the utility functions for the Gumbel-Max SCM.
  • src/sampling_utils.py: Contains the code for the Lewis' thinning algorithm (thinning_T function) and some other sampling utilities.
  • src/hawkes/hawkes.py: Contains the code for sampling from the hawkes process using the superposition property of tpps. It also includes the algorithm for sampling a counterfactual sequence of events given a sequence of observed events for a Hawkes process.
  • src/hawkes/hawkes_example.ipynb: Contains an example of running algorithm 3 (in the paper) for both cases where we have (1) both observed and un-observed events, and (2) the case that we have only the observed events.
  • ebola/graph_generation.py: Contains code to build the Ebola network based on the network of connecteddistricts. This code is adopted from thedisease-control project.
  • ebola/dynamics.py: Contains code for sampling counterfactual sequence of infections given a sequence of observed infections from the SIR porcess (the calculate_counterfactual function). The rest of the code is adopted from thedisease-control project, which simulates continuous-time SIR epidemics with exponentially distributedinter-event times.

The directoryebola/data/ebola contains the information about the Ebola network adjanceny matrix and the cleaned ebola outbreak data adopted from thedisease-control project.

The directoryebola/map/geojson contains the geographical information of the districts studied in the Ebola outbreak dataset. The geojson files are obtained fromNominatim.

The directoryebola/map/overall_data contains data for generating the geographical maps in the paper, and includs the overall number of infection under applying different interventions.

The directoriessrc/data_hawkes andsrc/data_inhomogeneous contain observational data used to generate Synthetic plots in the paper. You can use this data to re-generate paper's plots. Otherwise, you can simply generate new random samples by the code.

Experiments

Synthetic

Epidemiological

Citation

If you use parts of the code in this repository for your own research, please consider citing:

@inproceedings{noorbakhsh2022counterfactual,        title={Counterfactual Temporal Point Processes},        author={Noorbakhsh, Kimia and Gomez-Rodriguez, Manuel},        booktitle={Advances in Neural Information Processing Systems},        year={2022}}

Contributors3

  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp