This repository contains the code for InfSim, a simulation framework for cluster network interference published alongside the paper: Qini curve estimation under clustered network interference - Rickard K.A. Karlsson, Bram van den Akker, Felipe Moraes, Hugo Proença, Jesse H. Krijthe
The simulator targets researchers interested in causal inference or uplift modelling, and provides a playground for testing methodology for practitioners.
We recommend starting in the notebook section with hello-world-compare-policies-with-ground-truth.ipynb
.
InfSim has three main components (found under src/infsim
):
environments
, containing a base simulator that can be configured with various components (defined inutils
).policies
, containing various "optimal" and control policies that can be used for simulated data collection and benchmarking.utils
, containing configurable components for the base environment and general utils such as ground truth evaluation.
- Python 3.9+ (recommended 3.12+)
After cloning the repository, navigate to the root directory and install the requirements in a virtual environment.
Start by creating a virtual environment, make sure virtualenv is installed.
python -m venv venv
Activate virtual environment
source venv/bin/activate
Install requirements
python -m pip install -r requirements.txt
If you are using this codebase outside an IDE, you need to do an interactive installation in pip. For this, simply run the following in the root of the repo.
python -m pip install -e .
To validate everything is set up correctly, you can run the test suite from the root of the repo:
pytest tests
You know everything is ok when you see something like this.
==== 129 passed, 1 xfailed in 1.18s ====