summaryrefslogtreecommitdiffstats
path: root/ml/dlib/docs/docs/bayes.xml
blob: 2ed11fe1d9785eb5ca82f44a2e42b2e7c2f4bd66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="stylesheet.xsl"?>

<doc>
   <title>Bayesian Networks</title>

   <!-- ************************************************************************* -->

   <body>

         <p>
            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 <a href="bayes_net_ex.cpp.html">example program</a>.  
            
         </p>
         <p>
            The
            library also comes with a graphical application to assist in the
            creation of bayesian networks.  This application is one of the 
            <a href="bayes_net_gui_ex.cpp.html">example programs</a>, so to use it
            you have to compile it yourself. 
         </p>

   </body>

   <!-- ************************************************************************* -->

   <menu width="150">
    <top>
      <section>
         <name>Tools</name>
         <item>assignment</item>
         <item>joint_probability_table</item>
         <item>conditional_probability_table</item>
         <item>bayes_node</item>
         <item>bayesian_network_gibbs_sampler</item>
         <item>bayesian_network_join_tree</item>

      </section>

      <section>
         <name>Node Utilities</name>
         <item>set_node_value</item>
         <item>node_value</item>
         <item>node_is_evidence</item>
         <item>set_node_as_evidence</item>
         <item>set_node_as_nonevidence</item>
         <item>set_node_num_values</item>
         <item>node_num_values</item>
         <item>node_probability</item>
         <item>set_node_probability</item>
         <item>node_first_parent_assignment</item>
         <item>node_next_parent_assignment</item>
         <item>node_cpt_filled_out</item>

      </section>

    </top>  
   </menu>

   <!-- ************************************************************************* -->
   <!-- ************************************************************************* -->
   <!-- ************************************************************************* -->

   <components>
   
   <!-- ************************************************************************* -->
      
      <component>
         <name>bayesian_network_join_tree</name>
         <file>dlib/bayes_utils.h</file>
         <spec_file link="true">dlib/bayes_utils/bayes_utils_abstract.h</spec_file>
         <description>
            This object represents an implementation of the join tree algorithm 
            (a.k.a. the junction tree algorithm)
            for inference in bayesian networks.  
         </description>
         <examples>
            <example>bayes_net_ex.cpp.html</example>
            <example>bayes_net_gui_ex.cpp.html</example>
            <example>bayes_net_from_disk_ex.cpp.html</example>
         </examples>
                                 
      </component>
   
   <!-- ************************************************************************* -->
      
      <component>
         <name>bayesian_network_gibbs_sampler</name>
         <file>dlib/bayes_utils.h</file>
         <spec_file link="true">dlib/bayes_utils/bayes_utils_abstract.h</spec_file>
         <description>
            This object performs Markov Chain Monte Carlo sampling of a bayesian
            network using the Gibbs sampling technique. 
         </description>
         <examples>
            <example>bayes_net_ex.cpp.html</example>
         </examples>
                                 
      </component>
   
   <!-- ************************************************************************* -->
      
      <component>
         <name>bayes_node</name>
         <file>dlib/bayes_utils.h</file>
         <spec_file link="true">dlib/bayes_utils/bayes_utils_abstract.h</spec_file>
         <description>
            This object represents a node in a bayesian network.  It is
            intended to be used inside the <a href="containers.html#directed_graph">directed_graph</a> object to
            represent bayesian networks.
         </description>
                                 
         <examples>
            <example>bayes_net_ex.cpp.html</example>
            <example>bayes_net_gui_ex.cpp.html</example>
         </examples>
      </component>
   
   <!-- ************************************************************************* -->
      
      <component>
         <name>conditional_probability_table</name>
         <file>dlib/bayes_utils.h</file>
         <spec_file link="true">dlib/bayes_utils/bayes_utils_abstract.h</spec_file>
         <description>
            This object represents a conditional probability table.
         </description>
                                 
      </component>
   
   <!-- ************************************************************************* -->
      
      <component>
         <name>joint_probability_table</name>
         <file>dlib/bayes_utils.h</file>
         <spec_file link="true">dlib/bayes_utils/bayes_utils_abstract.h</spec_file>
         <description>
            This object represents a joint probability table.  
         </description>
                                 
      </component>

   <!-- ************************************************************************* -->
      
      <component>
         <name>assignment</name>
         <file>dlib/bayes_utils.h</file>
         <spec_file link="true">dlib/bayes_utils/bayes_utils_abstract.h</spec_file>
         <description>
            This object models an assignment of random variables to particular values.
            It is used with the <a href="#joint_probability_table">joint_probability_table</a> and 
            <a href="#conditional_probability_table">conditional_probability_table</a>
            objects to represent assignments of various random variables to actual values.
         </description>
         <examples>
            <example>bayes_net_ex.cpp.html</example>
            <example>bayes_net_gui_ex.cpp.html</example>
         </examples>
                                 
      </component>
   
   <!-- ************************************************************************* -->
      
      <component>
         <name>set_node_probability</name>
         <file>dlib/bayes_utils.h</file>
         <spec_file link="true">dlib/bayes_utils/bayes_utils_abstract.h</spec_file>
         <description>
            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  
            <a href="#bayes_node">bayes_node</a> given its parents when it is inside 
            a <a href="containers.html#directed_graph">directed_graph</a> object. 
         </description>
         <examples>
            <example>bayes_net_ex.cpp.html</example>
         </examples>
                                 
      </component>
   
   <!-- ************************************************************************* -->
      
      <component>
         <name>node_first_parent_assignment</name>
         <file>dlib/bayes_utils.h</file>
         <spec_file link="true">dlib/bayes_utils/bayes_utils_abstract.h</spec_file>
         <description>
            This is a function declared in the dlib::bayes_node_utils namespace.  It 
            is a convenience function that allows you to easily obtain an <a href="#assignment">assignment</a>
            that contains all the parents of a node in a bayesian network.
         </description>
         <examples>
            <example>bayes_net_gui_ex.cpp.html</example>
         </examples>
                                 
      </component>

   <!-- ************************************************************************* -->
      
      <component>
         <name>node_next_parent_assignment</name>
         <file>dlib/bayes_utils.h</file>
         <spec_file link="true">dlib/bayes_utils/bayes_utils_abstract.h</spec_file>
         <description>
            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 <a href="#assignment">assignments</a>
            of a node in a bayesian network.
         </description>
         <examples>
            <example>bayes_net_gui_ex.cpp.html</example>
         </examples>
                                 
      </component>

   <!-- ************************************************************************* -->
      
      <component>
         <name>node_cpt_filled_out</name>
         <file>dlib/bayes_utils.h</file>
         <spec_file link="true">dlib/bayes_utils/bayes_utils_abstract.h</spec_file>
         <description>
            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 <a href="#conditional_probability_table">conditional_probability_table</a> 
            completely filled out.
         </description>
         <examples>
            <example>bayes_net_gui_ex.cpp.html</example>
         </examples>
                                 
      </component>

   <!-- ************************************************************************* -->
      
      
      <component>
         <name>node_probability</name>
         <file>dlib/bayes_utils.h</file>
         <spec_file link="true">dlib/bayes_utils/bayes_utils_abstract.h</spec_file>
         <description>
            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  
            <a href="#bayes_node">bayes_node</a> given its parents when it is inside 
            a <a href="containers.html#directed_graph">directed_graph</a> object. 
         </description>
                                 
      </component>

   <!-- ************************************************************************* -->
      
      <component>
         <name>node_num_values</name>
         <file>dlib/bayes_utils.h</file>
         <spec_file link="true">dlib/bayes_utils/bayes_utils_abstract.h</spec_file>
         <description>
            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  
            <a href="#bayes_node">bayes_node</a> when it is inside 
            a <a href="containers.html#directed_graph">directed_graph</a> object. 
         </description>
                                 
      </component>

   <!-- ************************************************************************* -->
      
      <component>
         <name>set_node_num_values</name>
         <file>dlib/bayes_utils.h</file>
         <spec_file link="true">dlib/bayes_utils/bayes_utils_abstract.h</spec_file>
         <description>
            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  
            <a href="#bayes_node">bayes_node</a> when it is inside 
            a <a href="containers.html#directed_graph">directed_graph</a> object. 
         </description>
         <examples>
            <example>bayes_net_ex.cpp.html</example>
         </examples>
                                 
      </component>

   <!-- ************************************************************************* -->
      
      <component>
         <name>set_node_as_nonevidence</name>
         <file>dlib/bayes_utils.h</file>
         <spec_file link="true">dlib/bayes_utils/bayes_utils_abstract.h</spec_file>
         <description>
            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  
            <a href="#bayes_node">bayes_node</a> when it is inside 
            a <a href="containers.html#directed_graph">directed_graph</a> object. 
         </description>
         <examples>
            <example>bayes_net_ex.cpp.html</example>
         </examples>
                                 
      </component>

   <!-- ************************************************************************* -->
      
      <component>
         <name>set_node_as_evidence</name>
         <file>dlib/bayes_utils.h</file>
         <spec_file link="true">dlib/bayes_utils/bayes_utils_abstract.h</spec_file>
         <description>
            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  
            <a href="#bayes_node">bayes_node</a> when it is inside 
            a <a href="containers.html#directed_graph">directed_graph</a> object. 
         </description>
         <examples>
            <example>bayes_net_ex.cpp.html</example>
         </examples>
                                 
      </component>

   <!-- ************************************************************************* -->
      
      <component>
         <name>node_is_evidence</name>
         <file>dlib/bayes_utils.h</file>
         <spec_file link="true">dlib/bayes_utils/bayes_utils_abstract.h</spec_file>
         <description>
            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  
            <a href="#bayes_node">bayes_node</a> is evidence when it is inside 
            a <a href="containers.html#directed_graph"> directed_graph</a> object. 
         </description>
                                 
      </component>
      
   <!-- ************************************************************************* -->
      
      <component>
         <name>node_value</name>
         <file>dlib/bayes_utils.h</file>
         <spec_file link="true">dlib/bayes_utils/bayes_utils_abstract.h</spec_file>
         <description>
            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 
            <a href="#bayes_node">bayes_node</a> when it is inside a <a href="containers.html#directed_graph">
            directed_graph</a> object. 
         </description>
                                 
      </component>
      
   <!-- ************************************************************************* -->
      
      <component>
         <name>set_node_value</name>
         <file>dlib/bayes_utils.h</file>
         <spec_file link="true">dlib/bayes_utils/bayes_utils_abstract.h</spec_file>
         <description>
            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 
            <a href="#bayes_node">bayes_node</a> when it is inside a <a href="containers.html#directed_graph">
            directed_graph</a> object. 
         </description>
         <examples>
            <example>bayes_net_ex.cpp.html</example>
         </examples>
                                 
      </component>
      
   <!-- ************************************************************************* -->

   </components>

   <!-- ************************************************************************* -->


</doc>