This repository contains the replication package for our paper entitled "Evolving Regression Models for Causal Testing".
We use anaconda to manage dependencies and virtual environments.
While this is not essential, we strongly recommend you use some kind of virtual environment.
Our Python version and dependencies can be found in environment.yaml.
- Clone the repository and
cdinto it. All subsequent commands are to be run from within this directory. - Create a conda environment:
conda env create -f environment.yaml. This will create a conda environment calledgplr(Genetic Programming Linear Regression), although you can name the environment differently if you wish. - Activate the conda environment:
conda activate gplr.
We distribute our results data as zip files attached to the (CauSE release v1.0.0)[https://github.com/Luca0414/SURE-project/releases/tag/v1.0.0]. To use this data, simply extract the two results zip files in the main repo directory and skip straight to the (plotting)[#plotting] section to plot the results.
- Generate the configurations:
python generate_configurations.py. This will create a file calledconfigurations.txtwhich contains the 300 configurations we used for our paper. - Run
learn_equations.pywith each of the configurations inconfigurations.txt. This will create a directory calledresultscontaining JSON that record the output of each run.
The easiest way to do this to run seq 1 300 | xargs -n 1 bash learn_equations.sh configurations.txt.
This iteratively runs learn_equations.py with the configuration on each line of configurations.txt.
You can do this in parallel by adding -P [number of processes] to the xargs command.
You can also run this on an HPC cluster running slurm with seq 1 300 | xargs -n 1 sbatch learn_equations.sh configurations.txt.
This will submit 300 separate jobs, one for each configuration.
- Generate the figures in the paper by running
python plotting/process_results.py. This will create a directory calledfiguresin which it will place the figures and statistical analyses.
- Run
python learn_ctf_examples.py -o ctf_example_results -s $seedfor 30 random seeds. This will create a directory calledctf_example_results. This will create a directory calledctf_example_resultscontaining JSON files that record the output of each run. For our paper, we used seeds 1-30. The easiest way to recreate this is by doingseq 1 300 | xargs -n 1 python learn_ctf_examples.py -o ctf_example_results -s. This can also be run on HPC by modifyinglearn_equations.bashto calllearn_ctf_examples.py. - Generate the figures in the paper by running
python plotting/process_ctf_results.py. This will place the figures and statistical analyses within thefiguresdirectory (first creating the directory if it does not already exist).
To generate the figures in the paper, simply run the following commands from the main repo directory after having first extracted or re-collected the experimental results data.
python plotting/process_results.py
python plotting/process_ctf_results.py
This will generate all of the figures in the paper and more, which should be self explanatory.