Associate Dictionary

Context

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.

Usage

To associate a Dictionary for Arc properties, select

Main Menu > Data > Associate Dictionary > Arc >

and then select the property from the submenu:

pageArcpageNodepageState

Dictionary File Structure

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.

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.

Last updated

Logo

Bayesia USA

info@bayesia.us

Bayesia S.A.S.

info@bayesia.com

Bayesia Singapore

info@bayesia.com.sg

Copyright ยฉ 2024 Bayesia S.A.S., Bayesia USA, LLC, and Bayesia Singapore Pte. Ltd. All Rights Reserved.