Structure Learning scoring heuristic (Python wrapper)

The engine.
Post Reply
Marijn Peppelman
Posts: 21
Joined: Mon Jul 08, 2019 3:14 pm

Structure Learning scoring heuristic (Python wrapper)

Post by Marijn Peppelman » Thu Oct 17, 2019 2:33 pm

Hello,

The SMILE and wrapper manual state that the Bayesian Search structure learning is guided by a scoring heuristic, but does not elaborate what this heuristic is.
I'm familiar with some BN network structure scoring heuristics, such as the log likelihood and K2 algorithm, and was wondering how exactly this scoring heuristic is calculated and if it's accessible through the python wrapper.
My ultimate goal is to use a Genetic Algorithm to optimize the structure of a DBN, something the structure learning is currently not capable of, which needs a scoring function.
If the built in scoring heuristic is accessible, this would be great, but i would need to know how the score is calculated for documentation purposes.

Kind regards,

shooltz[BayesFusion]
Site Admin
Posts: 1247
Joined: Mon Nov 26, 2007 5:51 pm

Re: Structure Learning scoring heuristic (Python wrapper)

Post by shooltz[BayesFusion] » Mon Oct 21, 2019 11:32 am

Bayesian search algorithm uses log likelihood for scoring. You can obtain the score for the best network structure after learn() by calling get_last_score() method.

Marijn Peppelman
Posts: 21
Joined: Mon Jul 08, 2019 3:14 pm

Re: Structure Learning scoring heuristic (Python wrapper)

Post by Marijn Peppelman » Mon Oct 21, 2019 1:42 pm

Thanks for the answer.

I'm still a little bit confused about one thing though.
The GeNIe documentation indicated that the learning of the structure is not possible for Dynamic Bayesian Networks:
While GeNIe structure learning algorithms do not allow for learning the structure of
dynamic models, it is possible to learn the parameters of DBNs from time series
And I will be trying to learn the structure of a Dynamic Bayesian Network.
So when you say:
You can obtain the score for the best network structure after learn() by calling get_last_score() method
Do you mean that i need to call the learn() method for the parameter learner and then use the get_last_score() method, or is that part of the documentation out of date and structure learning IS supported for Dynamic Bayesian Networks, or is there some other misunderstanding?

shooltz[BayesFusion]
Site Admin
Posts: 1247
Joined: Mon Nov 26, 2007 5:51 pm

Re: Structure Learning scoring heuristic (Python wrapper)

Post by shooltz[BayesFusion] » Mon Oct 21, 2019 4:06 pm

GeNIe's manual is correct - at this point it's not possible to learn the structure of the DBN. If you have a dataset and use it as a data source for structure learning (including Bayesian Search learning), you'll get the network structure with non-temporal arcs (therefore the network is not a dynamic Bayesian network).
Do you mean that i need to call the learn() method for the parameter learner and then use the get_last_score() method
You need to call the learn() method of the structure learner, then follow with get_last_score(). The last in get_last_score's name is there, because it's possible to use a single instance of the learner for multiple learn() calls (each with different data, or with different options).

Marijn Peppelman
Posts: 21
Joined: Mon Jul 08, 2019 3:14 pm

Re: Structure Learning scoring heuristic (Python wrapper)

Post by Marijn Peppelman » Thu Oct 24, 2019 2:29 pm

Thank you.

Do I understand correctly that this means that acquiring the log likelihood score for an already defined DBN is thus impossible, since that would require the structure learning which can not accurately work with a DBN?

shooltz[BayesFusion]
Site Admin
Posts: 1247
Joined: Mon Nov 26, 2007 5:51 pm

Re: Structure Learning scoring heuristic (Python wrapper)

Post by shooltz[BayesFusion] » Thu Oct 24, 2019 8:25 pm

There's no publicly available function in SMILE which takes an existing network (DBN or not) and a dataset, then calculates the log likelihood sore.

Post Reply