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 with weights for the given dataset.
- 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.
- The database is expected to consist of entity and relationship tables (ER model). The primary key of the entities should should end with "_id".
- Foreign key constraints should be set for relationship tables. The foreign keys should cascade on delete.
- Download the package from [here]
- The package contains MBN_learning.jar, MBN_dt_learning.jar and a config.xml file.
- Change directory into the directory where you extract the package. You now have two options.
- The basic conversion method using standard moralization and log-conditional probabilities: run "java -jar MBN_learning.jar foo log" 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, Parameter Learning Output (MBN).
- Recommended: Context-sensitive moralization using decision trees and unit clauses: run "java -jar MBN_dt_learning.jar foo dtlsn" 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 with Weight.
- For unit clauses, the weight is the log-probability of the literal in the database. E.g., the weight of Intelligence(S,3) would be the logarithm of the percentage of students with intelligence level 3.
- For other conditional clauses, the weight is the log-difference between the Bayes net conditional frequency and the database unconditional frequency. E.g, given that the Bayes net contains a parameter P(int(S,3)|rank(S,1)) = 60%, and P(int(S,3)) = 20% in the database, the weight of clause int(S,3), rank(S,1) would be log(60%) - log(20%).
Examples of MLN files [here].We go through the steps above with a database server called kripke and a database schema called University hosted on Kripke.
- Modify the config.xml file to replace the line
jdbc:mysql://kripke/such "kripke" is replaced by your database server name.
- Change directory into the directory where you extract the package and run "java -jar MBN_learning.jar University log" in a linux terminal command where University is the name of a schema already in your MYSQL database.
- Output rules in datalog format + conditional probabilities.