Skip to content

Optimizing Bayesian networks score by pruning node orderings.

License

Notifications You must be signed in to change notification settings

felixleopoldo/dncDagger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

License

About The Project

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.

Getting Started

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

    $ 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

Native

Requirements

  • Boost 1.82.0 C++ library

R packages

  • RInside
  • Rcpp
  • Jmisc
  • argparser
  • igraph
  • BiDAG 2.0.0

For plotting:

  • ggplot2
  • dplyr
  • latex2exp
  • patchwork

Installation

After cloning th repo, type make

make

(back to top)

Usage

To run the algorithm with the data file data/p20n300gaussdata.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. If M_ij=1 in the adjacency matrix, then there is an edge i->j in the DAG.

Benchmarks

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/plotting.R')

(back to top)

License

Distributed under the Apache 2.0 License. See LICENSE.txt for more information.

(back to top)

About

Optimizing Bayesian networks score by pruning node orderings.

Resources

License

Stars

Watchers

Forks

Languages