next up previous contents
Next: RPDAGs Up: BNs Previous: BNs   Contents


Displaying BNs

This is not an essential part of MCMCMS but it is pretty nifty to be able to visualise all those BNs. You need to install graphviz http://www.research.att.com/sw/tools/graphviz/download.html then either add to TCLLIBPATH the location where Tcldot resides, or copy/move this file, somewhere where your tcl looks for lib files. If you are using latest graphviz (currently 1.10) you also need to copy file $prefix/share/graphviz/demo/doted to a directory in your $PATH. If you are using an older version, such as 1.7, make sure that the wish command in your (bash) $PATH is version 8.3 or older.

To display the current BN and the proposed one, use the display(next_display_at) run/1 option. For example run( [display(next_display_at), id(2)] ). This will display the first pair and then ask for a number. Pressing return, or 1 and then return, will display the next pair as well. An integer larger than 1 means display nth step from here, 0 halts Prolog and a negative number $-N$ will skip to the Nth jump from the current position.

To display individual BNs, represented as Prolog terms use,
 cd auxil; prolog
 ?- [disp_bn].
 ?- disp_asia.

which should display the ASIA BN. Nodes are colour coded. Red, for nodes with no parents, green for nodes with no children, but with parents, and orange for nodes with both children and parents. Other BNs can be displayed with disp_bn( BN ). See auxil/disp_bns.pl for the term representation of BNs.

To display bns sampled independently use
?- ['auxil/disp_sampled_bns.pl']. For example
?- disp_sbns( bn_un_2p, 10, donot_stop, [a,b,c,d,e,f,g,h] ).
displays 10 bns without waiting for user interaction in the between. The arguments of disp_sbns/4 are as follows:

SLP basename for SLP to be used. Looked for in `.' and ../slps/. The .slp extention is not necessary.
HowMany number of bns to generate.
Stop set to stop for pausing, on user-interaction, after each generated BN.
Nodes the nodes for the generated BNs.

To compare a learned model against a generator BN (here ASIA is the assumed default generator) do
 cd auxil ; prolog
 ?- [disp_cut_off].
 eg (after you have run run_test. above)
 ?- disp_cut_off( 0.95, '../test/tr_op0.8_or_3p_i1K_all_s1.counts' ).

The generic use is ?- disp_cut_off( CutOff, File ). The first argument is in the range $0 \leq CutOff \leq 1$ which means that the `learned' model is constructed by taking an edge to be in the model iff the $Times$ the edge appeared over the total number of $Iterations$ is greater that the $CutOff$ point, i.e. $Times/Iterations > CutOff$. The edges in the contrasting BN are coloured as follows

red for edges learned correctly
yellow for false negative (edges present in original only)
pink for false positive (edges present in learned only)
The second argument, $File$, should point to a .counts file.


next up previous contents
Next: RPDAGs Up: BNs Previous: BNs   Contents
Nicos Angelopoulos 2008-06-02