A Functor Bayes net can be converted to a Markov Logic Network using moralization. In graphical terms, moralization connects co-parents and omits edge directions. In logical terms, clauses become conjunctions. To obtain more compact Markov Logic Networks and better results, we recommend using context-sensitive moralization, which first compresses the conditional probability tables using decision trees before converting to MLN formulas. After the MLN structure (formulas) have been learned, you can use any MLN parameter learning method to assign weights (e.g., Alchemy, Tuffy). We also have carried out research on converting conditional probabilities from the Bayes nets to MLN weights; please see here.

The main file is packaged into a jar file. The input taken in by the package is a name of a database that already exists in an MYSQL and the output is an MLN structure without weights for the given dataset.

System Requirements

  • The system runs under Unix.
  • You need Java version 1.6 or greater.
  • An installation of MySQL. The command "mysql" should work from the command line.

Database requirements:

  1. The database is expected to consist of entity and relationship tables (ER model). The primary key of the entities should should end with "_id".
  2. Foreign key constraints should be set for relationship tables. The foreign keys should cascade on delete.

In order to use the package, please follow these steps.

  1. Download the package from [here]
  2. The package contains MBN_learning.jar, MBN_dt_learning.jar and a config.xml file.
  3. Modify the config.xml file to replace your connection setting to MYSQL.
  4. Change directory into the directory where you extract the package. You now have two options.
    1. The basic moralization method: run "java -jar MBN_learning.jar foo mbn" in a linux terminal command where foo is the name of a schema already in your MYSQL. By default, this adds unit clauses for each predicate. Within the Tetrad GUI, this routine can be called by clicking on dbEstimator, Export, Structure Output (MBN).
    2. Recommended: Context-sensitive moralization using decision trees: run "java -jar MBN_dt_learning.jar foo mbn" in a linux terminal command where foo is the name of a schema already in your MYSQL. By default, this adds unit clauses for each predicate. Within the Tetrad GUI, this routine can be called by clicking on dbEstimator, Export, Decision Tree Structure.
To illustrate, we go through the steps above with a database server called kripke and a database schema called University hosted on Kripke.

  1. Modify the config.xml file to replace the line jdbc:mysql://kripke/ such "kripke" is replaced by your database server name.
  2. Change directory into the directory where you extract the package and run "java -jar MBN_learning.jar University mbn" in a linux terminal command where University is the name of a schema already in your MYSQL database.

Examples

Examples of MLN files learned using the basic moralization method [here].


Wish List

  1. Output rules in datalog format.