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:
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.
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.
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