edu.ksu.cis.bnj.bbn.learning.score
Class BDEScore

java.lang.Object
  extended byedu.ksu.cis.bnj.bbn.learning.LearnerScore
      extended byedu.ksu.cis.bnj.bbn.learning.score.BDEScore
Direct Known Subclasses:
WeightedBDEScore

public class BDEScore
extends LearnerScore

BDE Scoring class

Author:
Roby Joehanes

Field Summary
protected  int[] arityCache
           
protected  int curNode
           
protected  double[] lnFactorialCache
           
protected  int nodeArity
           
protected  int[] nodes
           
protected  double result
           
protected  int ri_minus_one
           
protected  double ri_minus_one_fact
           
protected  int tupleSize
           
 
Fields inherited from class edu.ksu.cis.bnj.bbn.learning.LearnerScore
NO_CANDIDATES, owner, tally
 
Constructor Summary
BDEScore()
           
BDEScore(Learner l)
          Constructor for K2Score.
 
Method Summary
 double getScore(int curNode, int candidate, java.util.Set[] parentTable)
          BDE scoring is:
g(vi, parents(vi)) = \Pi_{j=1}^{qi} ((ri-1)!
protected  void iterateUniqueInstantiation(int depth, Tally tally)
          Recursively filter out the data according to the current node
protected  void precache()
           
 
Methods inherited from class edu.ksu.cis.bnj.bbn.learning.LearnerScore
getTallyer, initialize, setData, setOwner
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

result

protected double result

ri_minus_one

protected int ri_minus_one

ri_minus_one_fact

protected double ri_minus_one_fact

curNode

protected int curNode

nodeArity

protected int nodeArity

nodes

protected int[] nodes

lnFactorialCache

protected double[] lnFactorialCache

arityCache

protected int[] arityCache

tupleSize

protected int tupleSize
Constructor Detail

BDEScore

public BDEScore()

BDEScore

public BDEScore(Learner l)
Constructor for K2Score.

Parameters:
l -
Method Detail

precache

protected void precache()

getScore

public double getScore(int curNode,
                       int candidate,
                       java.util.Set[] parentTable)
BDE scoring is:
g(vi, parents(vi)) = \Pi_{j=1}^{qi} ((ri-1)!/(Nij+ri-1)!) \Pi_{k=1}^{ri} Nijk!

With:
vi is the node being queried
qi is the unique instantiation of vi's parents
ri is vi's arity
Nij is the total number of unique cases of one unique instantiation
Nijk is the total number of unique cases of one unique instantiation that contains the value of r_ik.

Then, we do a logarithm out of g.

In short, UTSL or RTFP.

Specified by:
getScore in class LearnerScore
Parameters:
curNode - The index of the currently evaluated node
candidate - The index of the parent candidate
parentTable - The array of Sets of integers. Each integer in the set is the index of currently assembled parent of each node.
Returns:
double the score
See Also:
edu.ksu.cis.bnj.bbn.learning.LearnerScore#score(java.lang.String, java.util.Set)

iterateUniqueInstantiation

protected void iterateUniqueInstantiation(int depth,
                                          Tally tally)
Recursively filter out the data according to the current node

Parameters:
depth -
tally -