BIF-BNT converter

Use this Web service to convert a Bayes net from BIF format to BNT format.  See below for more information on these data formats.



(This may take a few seconds.)

(The default BIF code above is adapted from the BNT documentation, which in turn adapted the example from Russell and Norvig, "Artificial Intelligence: a Modern Approach", Prentice Hall, 1995, page 454.)

More on the data formats

By BIF format we mean Fabio Cozman's Interchange Format for Bayesian Networks (BNIF), used by the Bayesian Network Repository to distribute Bayes nets.  BIF format is conceptually similar to, but distinct from, XMLBIF and XBN.  For parsing convenience and robustness, our converter interprets the BIF format specification as follows: By BNT format we mean MATLAB code that can be executed to create a Bayes net under Kevin Murphy's Bayes Net Toolbox (BNT).  More specifically, this converter returns a MATLAB script that, when run with BNT in the MATLAB path, creates 4 variables in the current workspace:
bnet
The Bayes net represented by the input BIF file.  The number of possible values for each (discrete) variable is stored in the row vector bnet.node_sizes.
adjacency
The adjacency matrix of the network, equal to bnet.dag.
node
A structure array whose field names are the names of each variable (wherein hyphens are replaced with underscores), and whose field values are the (topologically sorted and 1-based) indices of each variable.
value
A row cell array of cells, each of which is a column cell array of strings corresponding to a network node, listing the names of each possible value of the node.

Ken Shan <ken@digitas.harvard.edu>
December 28, 2000