## Book description

Master probabilistic graphical models by learning through real-world problems and illustrative code examples in Python

• Gain in-depth knowledge of Probabilistic Graphical Models
• Model time-series problems using Dynamic Bayesian Networks
• A practical guide to help you apply PGMs to real-world problems

Who This Book Is For

If you are a researcher or a machine learning enthusiast, or are working in the data science field and have a basic idea of Bayesian Learning or Probabilistic Graphical Models, this book will help you to understand the details of Graphical Models and use it in your data science problems. This book will also help you select the appropriate model as well as the appropriate algorithm for your problem.

What You Will Learn

• Get to know the basics of Probability theory and Graph Theory
• Work with Markov Networks
• Implement Bayesian Networks
• Exact Inference Techniques in Graphical Models such as the Variable Elimination Algorithm
• Understand approximate Inference Techniques in Graphical Models such as Message Passing Algorithms
• Sample algorithms in Graphical Models
• Grasp details of Naive Bayes with real-world examples
• Deploy PGMs using various libraries in Python
• Gain working details of Hidden Markov Models with real-world examples

In Detail

Probabilistic Graphical Models is a technique in machine learning that uses the concepts of graph theory to compactly represent and optimally predict values in our data problems. In real world problems, it's often difficult to select the appropriate graphical model as well as the appropriate inference algorithm, which can make a huge difference in computation time and accuracy. Thus, it is crucial to know the working details of these algorithms.

This book starts with the basics of probability theory and graph theory, then goes on to discuss various models and inference algorithms. All the different types of models are discussed along with code examples to create and modify them, and also to run different inference algorithms on them. There is a complete chapter devoted to the most widely used networks Naive Bayes Model and Hidden Markov Models (HMMs). These models have been thoroughly discussed using real-world examples.

Style and approach

An easy-to-follow guide to help you understand Probabilistic Graphical Models using simple examples and numerous code examples, with an emphasis on more widely used models.

## Publisher resources

1. Mastering Probabilistic Graphical Models Using Python
2. Mastering Probabilistic Graphical Models Using Python
3. Credits
6. www.PacktPub.com
1. Support files, eBooks, discount offers, and more
7. Preface
1. What this book covers
2. What you need for this book
3. Who this book is for
4. Conventions
6. Customer support
8. 1. Bayesian Network Fundamentals
1. Probability theory
2. Installing tools
3. Representing independencies using pgmpy
4. Representing joint probability distributions using pgmpy
5. Conditional probability distribution
6. Graph theory
7. Bayesian models
1. Representation
2. Factorization of a distribution over a network
3. Implementing Bayesian networks using pgmpy
4. Reasoning pattern in Bayesian networks
5. D-separation
8. Relating graphs and distributions
9. CPD representations
1. Deterministic CPDs
2. Context-specific CPDs
10. Summary
9. 2. Markov Network Fundamentals
1. Introducing the Markov network
1. Parameterizing a Markov network – factor
2. Gibbs distributions and Markov networks
2. The factor graph
3. Independencies in Markov networks
4. Constructing graphs from distributions
5. Bayesian and Markov networks
6. Summary
10. 3. Inference – Asking Questions to Models
1. Inference
2. Variable elimination
1. Analysis of variable elimination
2. Finding elimination ordering
3. Belief propagation
1. Clique tree
2. Constructing a clique tree
3. Message passing
4. Clique tree calibration
5. Message passing with division
1. Factor division
2. Querying variables that are not in the same cluster
4. MAP using variable elimination
5. Factor maximization
6. MAP using belief propagation
7. Finding the most probable assignment
8. Predictions from the model using pgmpy
9. A comparison of variable elimination and belief propagation
10. Summary
11. 4. Approximate Inference
1. The optimization problem
2. The energy function
3. Exact inference as an optimization
4. The propagation-based approximation algorithm
1. Cluster graph belief propagation
2. Constructing cluster graphs
5. Propagation with approximate messages
1. Message creation
2. Inference with approximate messages
1. Sum-product expectation propagation
2. Belief update propagation
6. Sampling-based approximate methods
7. Forward sampling
8. Conditional probability distribution
9. Likelihood weighting and importance sampling
10. Importance sampling
11. Importance sampling in Bayesian networks
12. Markov chain Monte Carlo methods
13. Gibbs sampling
14. The multiple transitioning model
15. Using a Markov chain
16. Collapsed particles
17. Collapsed importance sampling
18. Summary
12. 5. Model Learning – Parameter Estimation in Bayesian Networks
1. General ideas in learning
2. Learning as an optimization
3. Discriminative versus generative training
4. Parameter learning
5. Bayesian parameter estimation
6. Structure learning in Bayesian networks
1. Methods for the learning structure
2. Constraint-based structure learning
7. The Bayesian score for Bayesian networks
8. Summary
13. 6. Model Learning – Parameter Estimation in Markov Networks
1. Maximum likelihood parameter estimation
1. Likelihood function
2. Learning with approximate inference
3. Structure learning
2. Summary
14. 7. Specialized Models
1. The Naive Bayes model
1. Why does it even work?
2. Types of Naive Bayes models
2. Dynamic Bayesian networks
1. Assumptions
3. The Hidden Markov model
1. Generating an observation sequence
2. Computing the probability of an observation
4. Applications
5. Summary
15. Index

## Product information

• Title: Mastering Probabilistic Graphical Models Using Python
• Author(s): Ankur Ankan, Abinash Panda
• Release date: August 2015
• Publisher(s): Packt Publishing
• ISBN: 9781784394684