# 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 or download one of the binaries from the sourceforge download page.

Tools
assignment
joint_probability_table
conditional_probability_table
bayes_node
bayesian_network_gibbs_sampler
bayesian_network_join_tree
Node Utilities
set_node_value
node_value
node_is_evidence
set_node_as_evidence
set_node_as_nonevidence
set_node_num_values
node_num_values
node_probability
set_node_probability
node_first_parent_assignment
node_next_parent_assignment
node_cpt_filled_out
bayesian_network_join_tree
dlib/bayes_utils.h
dlib/bayes_utils/bayes_utils_abstract.h
This object represents an implementation of the join tree algorithm (a.k.a. the junction tree algorithm) for inference in bayesian networks.
bayes_net_ex.cpp.html
bayes_net_gui_ex.cpp.html
bayes_net_from_disk_ex.cpp.html
bayesian_network_gibbs_sampler
dlib/bayes_utils.h
dlib/bayes_utils/bayes_utils_abstract.h
This object performs Markov Chain Monte Carlo sampling of a bayesian network using the Gibbs sampling technique.
bayes_net_ex.cpp.html
bayes_node
dlib/bayes_utils.h
dlib/bayes_utils/bayes_utils_abstract.h
This object represents a node in a bayesian network. It is intended to be used inside the directed_graph object to represent bayesian networks.
bayes_net_ex.cpp.html
bayes_net_gui_ex.cpp.html
conditional_probability_table
dlib/bayes_utils.h
dlib/bayes_utils/bayes_utils_abstract.h
This object represents a conditional probability table.
joint_probability_table
dlib/bayes_utils.h
dlib/bayes_utils/bayes_utils_abstract.h
This object represents a joint probability table.
assignment
dlib/bayes_utils.h
dlib/bayes_utils/bayes_utils_abstract.h
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.
bayes_net_ex.cpp.html
bayes_net_gui_ex.cpp.html
set_node_probability
dlib/bayes_utils.h
dlib/bayes_utils/bayes_utils_abstract.h
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.
bayes_net_ex.cpp.html
node_first_parent_assignment
dlib/bayes_utils.h
dlib/bayes_utils/bayes_utils_abstract.h
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.
bayes_net_gui_ex.cpp.html
node_next_parent_assignment
dlib/bayes_utils.h
dlib/bayes_utils/bayes_utils_abstract.h
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.
bayes_net_gui_ex.cpp.html
node_cpt_filled_out
dlib/bayes_utils.h
dlib/bayes_utils/bayes_utils_abstract.h
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.
bayes_net_gui_ex.cpp.html
node_probability
dlib/bayes_utils.h
dlib/bayes_utils/bayes_utils_abstract.h
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.
node_num_values
dlib/bayes_utils.h
dlib/bayes_utils/bayes_utils_abstract.h
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.
set_node_num_values
dlib/bayes_utils.h
dlib/bayes_utils/bayes_utils_abstract.h
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.
bayes_net_ex.cpp.html
set_node_as_nonevidence
dlib/bayes_utils.h
dlib/bayes_utils/bayes_utils_abstract.h
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.
bayes_net_ex.cpp.html
set_node_as_evidence
dlib/bayes_utils.h
dlib/bayes_utils/bayes_utils_abstract.h
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.
bayes_net_ex.cpp.html
node_is_evidence
dlib/bayes_utils.h
dlib/bayes_utils/bayes_utils_abstract.h
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.
node_value
dlib/bayes_utils.h
dlib/bayes_utils/bayes_utils_abstract.h
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.
set_node_value
dlib/bayes_utils.h
dlib/bayes_utils/bayes_utils_abstract.h
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.
bayes_net_ex.cpp.html