The D&C order pruner is an exact structure learning algorithm for Bayesian networks, operating on the space of topological orders and using a divide and conquer technique.
Clone the repository and make
git clone https://github.com/felixleopoldo/dncpruner.git
Easiest way to run the algorithms is to build a Docker image from the Docker file and run the algorithm in a container.
$ docker build . -t dnc
Run the container and mount the current directory, with the repo
$ docker run -w /mnt -v $(pwd):/mnt -it dnc
Inside the container run
make
Now follow the instructions below
- Boost 1.82.0 C++ library
- RInside
- Rcpp
- Jmisc
- argparser
- igraph
- BiDAG 2.0.0
- ggplot2
- dplyr
- latex2exp
- patchwork
After cloning th repo, type make
make
To run the algorithm with the data file data/asiadata.csv type
./dncpruner --filename data/asiadata.csv --scoretype bge --am 0.1 --aw NULL --output_csv dag_adjmat.csv
The estimate dag is then as an adjacency matrix in the CSV file dag_adjmat.csv, where M_ij=1 in the adjacency matrix corresponds to the edge i->j in the DAG.
To generate benchmarks (with the setting specified in R/benchmark_dncpruner.R) type
Rscript R/benchmark_dncpruner.R --output_dir results --filename res.csv --seeds_from 1 --seeds_to 5
This produces joined results in the file res.csv which can be analysed by typing
source('R/benchmark_dncpruner.R --filename res.csv')
Distributed under the Apache 2.0 License. See LICENSE.txt
for more information.