Code for Exporting a learned First-Order Bayesian Network to a Bayesian Network in BIF format.
Input:
- A relational database
- A learned Bayesian network (using FactorBase).
Output: An .xml file in BIF format.
You have used BIF_Generator if you run the FactorBase on your relational database. The Bif_'YOURDATABASENAME'.xml is created in FactorBase/jar folder. If you wish to run the BIF_Generator separately, please follow these steps.
-
Import data into your database and run FactorBase.
-
Clone the BIF_Generator repository by
git clone https://github.com/sfu-cl-lab/BIF_Generator.git
-
Navigate to
BIF_Generator/cfg
folder and modify the config filesubsetctcomputation.cfg
by copying the same config file content that you used to run FactorBase.
-
Navigate to
BIF_Generator/jar
where BIF_Generator.jar is located.Export the learned Bayesian Network (BN) by
java -jar BIF_Generator.jar
.OR
Navigate to parent directory
BIF_Generator
and compile the .java source code byjavac -cp ".:./lib/*" BIF_Generator.java
java -cp ".:./lib/*" BIF_Generator
-
The output file is created in the folder
Bif_Generator
namedBif_<YOURDATABASENAME>.xml
We have tested the BIF_Generator with the AIspace tool from UBC.
-
Download and run the tool
Download tool (.jar format) and
Run byjava -jar bayes.jar
OR
Download tool (.exe format) and
Run the .exe file -
Go to
File > Load from File
and select theBif_<YOURDATABASENAME>.xml
in the folderBif_Generator
.