This code accompanies a paper (arXiv:2205.08047) on a model called the additive-covariate stochastic block model (ACSBM), an extension of the popular stochastic block model. The purpose of this model and the proposed spectral fitting method is to separate observed homophily from latent network structure. For details on the spectral fitting method, please see the paper.
Examples can be found in the /examples directory. In particular:
simpsons-paradox
: This illustrates a Simpson's paradox example in the network setting. Each node has two binary covariates. The first covariate induces positive homophily, while the second induces negative homophily.misc-examples
: A notebook filled with a smattering of miscellaneous examples of networks fit by the proposed algorithm.
Simulation code (including settings) can be found in /src/simulator.py
. The included Dockerfile
can be used to generate a Docker image capable of running all code. This code has been tested on Python 3.10 with the modules listed in requirements.txt
.