This repository represents a toolkit for structure learning of DBNs in the CoDiet [1]
project. Currently, this repository is under development. The goal is to finally
extend this repository into a toolkit that would complement pgmpy library [2] in the
case of Dynamic Bayesian Networks.
The repository contains several bundles of code. There are structured as follows:
- The
iofolder contains tools for loading and processing data. The organization of the data is focused on the types of data that will arise in the CoDiet project. TheDataclass contains a collection ofSamples, which will represent individual patients. EachSamplehas a set of static features, and a set of dynamic features that are stored in a data frame. For each of the variables, annotations are available, so that a relevant set of variables can be selected for an experiment. - Once the data are loaded, the user can use one of the
learnersto learn the structure and parameters of the model. There are several learners available. For some, external libraries are used, as in the caseDyNoTearsDBN, some are related to publication [3], asMILPDBN. - The
structurepackage contains a representation of the learned model. The model consists of instances ofNode, which represent individual variables. Then, each node is attached transitions that have a probability distribution overinput_nodes. See filemakeafewDBNs.pyintestsfor example of structure creation. - In
utils, you can find helper code. - The
evaluationfolder (under development) will contain tools to compare different results obtained by learners. - Folder
dag_gflownetcontians a snapshot of the GFlowNet package [6]. As this package cannot be installed usingpip(yet), we decided to include its copy in here. - In
gfndirectory, you can find code for using GFlowNet. - Folder
R_codescontains R code that can be used to learn using BNStruct [4] and MCMC BiDAG package [5].
[3] https://arxiv.org/abs/2406.17585
[4] https://cran.r-project.org/web/packages/bnstruct/index.html
[5] https://cran.r-project.org/web/packages/BiDAG/index.html
