# dlib C++ Library - Bayesian Networks

Bayesian Networks

This page documents all the tools within the dlib library that relate to the construction and evaluation of Bayesian networks. If you want a quick introduction to the tools then you should consult the Bayesian Net example program.

The library also comes with a graphical application to assist in the creation of bayesian networks. This application is one of the example programs, so to use it you have to compile it yourself.

[top]

# assignment

This object models an assignment of random variables to particular values. It is used with the joint_probability_table and conditional_probability_table objects to represent assignments of various random variables to actual values.
C++ Example Programs: bayes_net_ex.cpp, bayes_net_gui_ex.cpp
More Details...
#include <dlib/bayes_utils.h>
[top]

# bayesian_network_gibbs_sampler

This object performs Markov Chain Monte Carlo sampling of a bayesian network using the Gibbs sampling technique.
C++ Example Programs: bayes_net_ex.cpp
More Details...
#include <dlib/bayes_utils.h>
[top]

# bayesian_network_join_tree

This object represents an implementation of the join tree algorithm (a.k.a. the junction tree algorithm) for inference in bayesian networks.
C++ Example Programs: bayes_net_ex.cpp, bayes_net_gui_ex.cpp, bayes_net_from_disk_ex.cpp
More Details...
#include <dlib/bayes_utils.h>
[top]

# bayes_node

This object represents a node in a bayesian network. It is intended to be used inside the directed_graph object to represent bayesian networks.
C++ Example Programs: bayes_net_ex.cpp, bayes_net_gui_ex.cpp
More Details...
#include <dlib/bayes_utils.h>
[top]

# conditional_probability_table

This object represents a conditional probability table.
More Details...
#include <dlib/bayes_utils.h>
[top]

# joint_probability_table

This object represents a joint probability table.
More Details...
#include <dlib/bayes_utils.h>
[top]

# node_cpt_filled_out

This is a function declared in the dlib::bayes_node_utils namespace. It is a convenience function that allows you to easily verify that a node in a bayesian network has its conditional_probability_table completely filled out.
C++ Example Programs: bayes_net_gui_ex.cpp
More Details...
#include <dlib/bayes_utils.h>
[top]

# node_first_parent_assignment

This is a function declared in the dlib::bayes_node_utils namespace. It is a convenience function that allows you to easily obtain an assignment that contains all the parents of a node in a bayesian network.
C++ Example Programs: bayes_net_gui_ex.cpp
More Details...
#include <dlib/bayes_utils.h>
[top]

# node_is_evidence

This is a function declared in the dlib::bayes_node_utils namespace. It is a convenience function that allows you to easily determine if a bayes_node is evidence when it is inside a directed_graph object.
More Details...
#include <dlib/bayes_utils.h>
[top]

# node_next_parent_assignment

This is a function declared in the dlib::bayes_node_utils namespace. It is a convenience function that allows you to easily loop through all the parent assignments of a node in a bayesian network.
C++ Example Programs: bayes_net_gui_ex.cpp
More Details...
#include <dlib/bayes_utils.h>
[top]

# node_num_values

This is a function declared in the dlib::bayes_node_utils namespace. It is a convenience function that allows you to easily obtain the number of values of a bayes_node when it is inside a directed_graph object.
More Details...
#include <dlib/bayes_utils.h>
[top]

# node_probability

This is a function declared in the dlib::bayes_node_utils namespace. It is a convenience function that allows you to easily obtain the probability of a bayes_node given its parents when it is inside a directed_graph object.
More Details...
#include <dlib/bayes_utils.h>
[top]

# node_value

This is a function declared in the dlib::bayes_node_utils namespace. It is a convenience function that allows you to easily obtain the value of a bayes_node when it is inside a directed_graph object.
More Details...
#include <dlib/bayes_utils.h>
[top]

# set_node_as_evidence

This is a function declared in the dlib::bayes_node_utils namespace. It is a convenience function that allows you to easily set the evidence flag of a bayes_node when it is inside a directed_graph object.
C++ Example Programs: bayes_net_ex.cpp
More Details...
#include <dlib/bayes_utils.h>
[top]

# set_node_as_nonevidence

This is a function declared in the dlib::bayes_node_utils namespace. It is a convenience function that allows you to easily remove the evidence flag of a bayes_node when it is inside a directed_graph object.
C++ Example Programs: bayes_net_ex.cpp
More Details...
#include <dlib/bayes_utils.h>
[top]

# set_node_num_values

This is a function declared in the dlib::bayes_node_utils namespace. It is a convenience function that allows you to easily set the number of values of a bayes_node when it is inside a directed_graph object.
C++ Example Programs: bayes_net_ex.cpp
More Details...
#include <dlib/bayes_utils.h>
[top]

# set_node_probability

This is a function declared in the dlib::bayes_node_utils namespace. It is a convenience function that allows you to easily set the probability of a bayes_node given its parents when it is inside a directed_graph object.
C++ Example Programs: bayes_net_ex.cpp
More Details...
#include <dlib/bayes_utils.h>
[top]

# set_node_value

This is a function declared in the dlib::bayes_node_utils namespace. It is a convenience function that allows you to easily modify the value of a bayes_node when it is inside a directed_graph object.
C++ Example Programs: bayes_net_ex.cpp
More Details...
#include <dlib/bayes_utils.h>