To associate a Dictionary for Arc properties, select
Main Menu > Data > Associate Dictionary > Arc >
and then select the property from the submenu:
Arcs
Specifies the addition or removal of arcs for the currently active Bayesian network. If an arc removal is specified, it will precede any addition of an arc.
Before adding arcs, any constraints applicable to the active Bayesian network and the Temporal Indices will be checked. If a specified arc addition is inconsistent with the existing constraint, the arc won't be added.
Syntax Examples:
N1->N2=
true
adds an arc from N1 to N2
N1->N2=
false
removes the arc from N1 to N2
N1<-N2=
true
adds an arc from N2 to N1 (note the reversal of the arrow symbol <-
produces an arc in the opposite direction).
Note that you need to add an escape character \
before any spaces in node names. Otherwise, a space will be interpreted as a delimiter:
N\ 1->Node\ 2=
true
adds an arc from N 1 to N 2
Instead of the ->
characters, you can also use space
, the equal sign =
, and --
as a delimiter between the start node and end node. With these alternative delimiters, the order of the nodes determines the arc direction.
N1 N2=
true
adds an arc from N1 to N1
N1=N2=
true
adds an arc from N1 to N2
N1--N2=
true
adds an arc from N1 to N2
N1 N2=
true
adds an arc from N1 to N2
Forbidden Arcs
Specifies the addition or removal of Forbidden Arcs between nodes and classes
Syntax Examples:
N1->N2
adds a Forbidden Arc from N1 to N2
N1--N2
adds a Forbidden Arc between N1 and N2
ClassA->ClassB
applies Forbidden Arcs from any nodes in ClassA to any nodes in ClassB
N1
N2
removes any existing Forbidden Arc between N1 and N2. Note the space in the syntax, which triggers the removal of the Forbidden Arc.
Arc Comments
Adds, updates, or removes Arc Comments to arcs in the active network. Arc Comments are stored in HTML format.
Syntax Examples:
N1->N2=<p>This is a sample <b>Arc Comment</b>.</p>
adds an Arc Comment to the arc between N1 and N2.
N1->N2=
removes an existing Arc Comment from the arc between N1 and N2.
The added Arc Comment can be edited in the Arc Editor: Arc Contextual Menu > Edit
Arc Colors
Defines colors for arcs in the active network. You can specify the color for each arc individually by providing the hex code of the color
Syntax Examples:
N1->N2=000000
changes the color of the arc between N1 and N2 to black.
N1->N2=FF0000
changes the color of the arc between N1 and N2 to bright red.
Note that there is no option to revert an arc color to the default color. When changing Arc Colors via a Dictionary, the colors must always be specified explicitly.
Structural Priors
Assigns Structural Priors to arcs in the active network.
Fixed Arcs
Applies Fixed Arcs to the active network or removes them.
Syntax Example:
N1->N2=true
changes the arc between N1 and N2 to a Fixed Arc.
N1->N2=false
changes the arc between N1 and N2 to a normal, non-fixed arc.
Node Renaming: allows renaming each node with a new name. These new names must be, of course, all different.
Comments: allows associating a comment with each node that is in the file.
Classes: allows organizing nodes in subsets called classes . A node can belong to several classes at the same time. These classes allow generalizing some node's properties to the nodes belonging to the same classes. They allow also creating constraints over the arc creation during learning.
Colors: allows associating colors with the nodes or classes that are in the file. The colors are written as Red Green Blue with 8 bits by channel in hexadecimal format (web format): for example the color red is 255 red 0 green 0 blue, it will give FF0000. Green gives 00FF00, yellow gives FFFF00, etc.
Images: allows associating colors with the nodes or classes that are in the file. The images are represented by their path relatively to the directory where the dictionary is.
Costs: allows associating with each node a cost . A node without cost is called not observable.
Temporal Indices: allows associating temporal indices with the nodes that are in the file. These temporal indexes are used by the BayesiaLab's learning algorithms to take into account any constraints over the probabilistic relations, as for example the no adding arcs between future nodes to past nodes. The rule that is used to add an arc from node N1 to node N2 is:
If the temporal index of N1 is positive or null, then the arc from N1 to N2 is only possible if the temporal index of N2 is greater of equal to the index of N1.
Local Structural Coefficients: allows setting the local structural coefficient of each specified node or each node of each specified class.
State Virtual Numbers: allows setting the state virtual number of each specified node or each node of each specified class.
Locations: allows setting the position of each node.
State:
State Renaming: allows renaming each state of each node with a new name.
State Values: allows associating with each state of each node a numerical value .
State Long Names: allows associating with each state of each node a long name more explicit than the default state name. This name can be used in the different ways to export a database, in the html reports and in the monitors.
Filtered States: allows defining a state to each node as a filtered state .
Dictionaries offer a convenient way to manage a large set of properties related to a Bayesian network using text files with a human-readable syntax.
Dictionaries are plain text files that can be opened and edited outside of BayesiaLab in any text editor.
Using Dictionaries, you can export the properties of a given network or associate properties that you previously saved.
Dictionaries are specific to the elements of a Bayesian network, e.g., Arcs, Nodes, and States and their respective properties.
To associate a Dictionary for Arc properties, select
Main Menu > Data > Associate Dictionary > Arc >
and then select the property from the submenu:
Dictionary File Structure
As indicated by the syntax, the name of the node, class or state in the text file cannot contain equal, space or tab characters. If the node names contain such characters in the networks, those characters must be written with a {color} (backslash) character before in the text file: for example the node named Visit Asia will be written Visit\ Asia in the file.
In order to specifically differenciate a nam which is the same for a classe, a node or a state, you must add at the end of the name the suffix "c" for a class, "n" for a node and "s" for a state.
If your network contains non-ASCII characters, you must save your own dictionaries with UTF-8 (Unicode) encoding. For example, in MS Excel, choose "save as" and select "Text Unicode (*.txt)" as type of file. In Notepad, choose "save as" and select "UTF-8" as encoding. If your file contains only ASCII character you can let the default encoding (depending on the platform) but it is strongly encouraged to use UTF-8 (Unicode) encoding in order to create dictionary files that doesn't depend on the user's platform. So, for example, a chinese dictionary can be read by a german without any problem whatever the used platforms are. If you are not sure how to save a file with UTF-8 encoding, you should export a dictionary with BayesiaLab, modify and save it (with any text editor) and load it in BayesiaLab.
Dictionary File Structures | ||
---|---|---|
Arc
Arcs
Name of the arc's starting node or class, -> , <- or even -- to indicate the both possible orientations, name of the arc's ending node or class, Equal, Space or Tab , true for an added arc or false for a removed arc. The last occurrence is always chosen.
Forbidden Arcs
Name of the arc's starting node or class, -> , <- or even -- to indicate the both possible orientations, name of the arc's ending node or class.
Comments
Name of the arc's starting node or class, -> , <- or even -- to indicate the both possible orientations, name of the arc's ending node or class, Equal, Space or Tab , comment . The comment can be any character string without return (in html or not). The last occurrence is always chosen.
Colors
Name of the arc's starting node or class, -> , <- or even -- to indicate the both possible orientations, name of the arc's ending node or class, Equal, Space or Tab , color . The color is defined as Red Green Blue 8 bits by channel color written in hexadecimal (web format). For example green gives 00FF00, yellow gives FFFF00, blue gives 0000FF, pink gives FFC0FF,etc. The last occurrence is always chosen.
Fixed Arcs
Name of the arc's starting node or class, -> , <- or even -- to indicate the both possible orientations, name of the arc's ending node or class, Equal, Space or Tab , true for an fixed arc or false for a not fixed arc. The last occurrence is always chosen.
Node
Node Renaming
Name of the node Equal, Space or Tab new node name. The new name must be valid (different from t or T and without?). A node can be present only once otherwise the last occurrence is chosen.
Comments
Name of the node or the class Equal, Space or Tab Comment. The comment can be any character string without return (in html or not). A node can be present only once otherwise the last occurrence is chosen.
Classes
Name of the node Equal, Space or Tab Name of the class. The class can be any character string. A node present several times will be associated with different classes.
Colors
Name of a node or a class Equal, Space or Tab Color The color is defined as Red Green Blue 8 bits by channel color written in hexadecimal (web format). For example green gives 00FF00, yellow gives FFFF00, blue gives 0000FF, pink gives FFC0FF, etc. A node can be present only once otherwise the last occurrence is chosen.
Images
Name of a node or a class Equal, Space or Tab path to the image relatively to the directory where the dictionary is. The image path must be a valid relative path or an empty string. A node can be present only once otherwise the last occurrence is chosen.
Costs
Name of the node Equal, Space or Tab value of the cost or empty if we want the node to be not observable. The cost is an empty string or a real number superior or equal to 1. A node can be present only once otherwise the last occurrence is chosen.
Temporal Indices
Name of the node Equal, Space or Tab value of the index or empty if we want to delete an already existent index The index is an integer. A node can be present only once otherwise the last occurrence is chosen.
Local Structural Coefficients
Name of the node Equal, Space or Tab value of the local structural coefficient or empty if we want to reset to the default value 1. The local structural coefficient is an empty string or a real number superior to 0. A node can be present only once otherwise the last occurrence is chosen.
State Virtual Numbers
Name of the node Equal, Space or Tab virtual number of states or empty if we want to delete an already existent number. The state virtual number is an empty string or an integer superior or equal to 2. A node can be present only once otherwise the last occurrence is chosen.
Locations
Name of the node Equal, Space or Tab , position. The location is represented by two real numbers separated by a Space . The first number represent the x-coordinate of the node and the second number the y-coordinate. A node can be present only once otherwise the last occurrence is chosen.
State
State Renaming
Name of the node or class dot (.) name of the state Equal, Space or Tab new state name or State name Equal, Space or Tab new state name if we want to rename the state for all nodes. The new name is a valid state name. A state can be present only once otherwise the last occurrence is chosen.
State Values
Name of the node or class dot (.) name of the state Space or Tab real value or Name of the state Equal, Space or Tab real value if we want to associate a value with a state whatever the node. The value is a real number. A state can be present only once otherwise the last occurrence is chosen.
State Long Names
Name of the node or class dot (.) name of the state Equal, Space or Tab long name or Name of the state Equal, Space or Tab long name if we want to associate a long name with a state whatever the node. The long name is a string. A state can be present only once otherwise the last occurrence is chosen.
Filtered States
Name of the node or class dot (.) name of the filtered state. Name of the filtered state if we want to set the filter property to the state whatever the node. A state can be present only once otherwise the last occurrence is chosen.