Bayesian networks

The probabilities in a ProbLog program can be learned from partial interpretations. The LFI (Learning From Interpretations) parameter estimation algorithm was introduced in the following paper:

  • B. Gutmann, I. Thon and L. De Raedt. Learning the parameters of probabilistic logic programs from interpretations. Machine Learning and Knowledge Discovery in Databases, volume 6911, pp. 581 - 596, Springer, 2011. PDF DOI TR ERR

  • Below we learn the parameters of the Alarm program. We use the ‘plain’ ProbLog encoding (learning in combination with annotated disjunctions is currently not yet supported).

    When learning, the probability annotation in a probabilistic fact can be one of three possible forms.

    • Of the form t(_), as in for instance t(_)::p_alarm1. This indicates that the probability of this fact is to be learned from data. ProbLog2 uses an EM algorithm to perform parameter learning. In the first iteration of EM, each probability is initialized to a random value. Note that t is an abbreviation of ‘tunable’.
    • Of the form t(p), with p a probability, as in for instance t(0.5)::burglary. This again indicates that the probability of this fact is to be learned from data, but instead of initializing this probability randomly, it will be set to the value p in the first iteration of EM.
    • Of the form p, with p a probability, as in for instance 0.2::earthquake. This indicates that the probability of this fact is fixed (not learned).

    Apart from the input field for the program, the learning interface has a second input field that is used for supplying the data. The data is a set of partial interpretations separated by “—” lines (see below). Each partial interpretation is given in the “evidence” format as also used for inference. Below we use a dataset consisting of three partial interpretations. Not all atoms need to be present in an interpretation as can be observed in this example. This is thus an instance of learning from incomplete data.

    %%% The program: t(0.5)::burglary. 0.2::earthquake. t(_)::p_alarm1. t(_)::p_alarm2. t(_)::p_alarm3. alarm :- burglary, earthquake, p_alarm1. alarm :- burglary, \+earthquake, p_alarm2. alarm :- \+burglary, earthquake, p_alarm3.
    %%% The data: evidence(burglary,false). evidence(alarm,false). ----- evidence(earthquake,false). evidence(alarm,true). evidence(burglary,true). ----- evidence(burglary,false).

    When pressing ‘Evaluate’, ProbLog2 starts learning and when finished returns the learned probabilities. Note that these probabilities might vary from run to run because they depend on the random initialization used in the first EM iteration.

    If you want to perform learning using a locally installed version of ProbLog you can use:

    $ problog lfi myprogram.pl myexamples.pl -O mylearnedprogram.pl