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

3 comments:

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

    most important (changes less frequently)
    (first parent)

    less important
    (second parent)

    even less important
    (third parent)

    etc..

    this applies to "bit" values as desribed above.

    ReplyDelete
  2. nice info..
    by: sapator.blogspot.com

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

    SMILE_LibraryUsage_FromBartoszKosarzyckiMastersThesis_20110506.pdf

    ReplyDelete

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