This repo contains code for reproducing the results in the paper Sample-Efficient L0-L2 Constrained Structure Learning of Sparse Ising Models published at the 35th AAAI Conference on Artificial Intelligence (AAAI 2021).
Dependencies can be installed via
pip install -r requirements.txt
python setup.py develop
This is the main folder. It contains the following files:
data.py
generates data for Ising models with the topologies described in the paper, without or with the use of a Gibbs-samplertest_data.py
test the data generation codel1_logreg.py
implements the L1 logistic regression estimatorl1_constrained_logreg.py
implements the L1-constrained logistic regression estimatorl1_ise.py
implements the L1 interaction screening estimatorl0_l2constrained_logreg.py
implements the proposed L0-L2 logistic regression estimatorl0_l2constrained_ise.py
implements the proposed L0-L2 interaction screening estimator
We refer to the main paper for a presentation of the different algorithms.
This folder contains the bash scripts used to generate the results in the main paper for Examples 1 and 2.
Each bash script calls the compare_ising_models.py
python script.
test_compare_ising_models_P16-ex1_small.sh
tests the implementation for a smaller number of independent problems (4 instead of 30).
This folder contains a notebook which displays the simulation results as graphs which are similar to the ones in the main paper.
The default code assumes that the script compare_ising_models_P16-ex1.sh
has been run.