Search This Blog

Wednesday, April 20, 2011

C# SMILE.NET; SMILE.Network; SetNodeDefinition(); CPT; Conditional Probability Table

The order of probabilities is given by considering the state of the first parent of the node as the most significant coordinate (thinking of the coordinates in terms of bits), then the second parent, and so on, and finally considering the coordinate of the node itself as the least significant one.

The order of CPT depends on the order of adding nodes and arcs, as well as the order of defining states.

            net.AddNode(Network.NodeType.Cpt, "R");
            net.SetOutcomeId("R", 0, "T");
            net.SetOutcomeId("R", 1, "F");
            net.AddNode(Network.NodeType.Cpt, "C");
            net.SetOutcomeId("C", 0, "T");
            net.SetOutcomeId("C", 1, "F");
            net.AddNode(Network.NodeType.Cpt, "Hr");
            net.AddArc("R", "Hr");
            net.AddArc("C", "Hr");

So T is the first state; R is the first parent and C is the second parent. Here we have T state = 1; F state = 0;

node itself (Hr) first parent (R) second parent (C)
1 1 1
0 1 1
1 1 0
0 1 0
1 0 1
0 0 1
1 0 0
0 0 0


  1. less important (changes most frequently)
    (node itself)

    most important (changes less frequently)
    (first parent)

    less important
    (second parent)

    even less important
    (third parent)


    this applies to "bit" values as desribed above.

  2. nice info..

  3. Hope this helps someone. This is SMILE's library usage part from my Master's thesis:



If you like this post, please leave a comment :)