O'Reilly logo

Building Probabilistic Graphical Models with Python by Kiran R Karkera

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Reasoning patterns

In this section, we shall look at different kinds of reasoning used in a Bayes network. We shall use the Libpgm library to create a Bayes network. Libpgm reads the network information such as nodes, edges, and CPD probabilities associated with each node from a JSON-formatted file with a specific format. This JSON file is read into the NodeData and GraphSkeleton objects to create a discrete Bayesian network (which, as the name suggests, is a Bayes network where the CPDs take discrete values). The TableCPDFactorization object is an object that wraps the discrete Bayesian network and allows us to query the CPDs in the network. The JSON file for this example, job_interview.txt, should be placed in the same folder as the IPython ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required