Code for converting a learned First-Order Bayesian Network to a Markov Logic Network.
Input:
- A relational database
- A learned Bayesian network (using FactorBase).
Output:
A .mln file containing
- Markov Logic Network formulas.
- Weights for the formulas.
- First import data into your database and run FactorBase.
- Set up a configuration file as for running FactorBase. If you use MLNExporter after Factorbase, you can just keep the same configuration file.
- Convert the learned BN into MLN by running
java -jar MLNExporter.jar
.
Our conversion method follows the moralization method of Domingos and Richardson; see also the Alchemy FAQ.
Currently we add unit clauses as recommended by Domingos and Richardson at the bottom of the file. (e.g. RA(Student, Prof)). We do not output weights for the unit clauses.
- If you want an MLN structure with weights assigned to each formula, delete the unit clauses.
- If you want an MLN structure without weights, leave the unit clauses, and delete the weights.