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

java.lang.Object
  extended byedu.ksu.cis.bnj.bbn.learning.LearnerScore
      extended byedu.ksu.cis.bnj.bbn.learning.score.SparseScore
          extended byedu.ksu.cis.bnj.bbn.learning.score.DiscrepancyScore

public class DiscrepancyScore
extends SparseScore

A class that implements the discrepancy score as described in Friedman's paper (i.e. MDisc).

Author:
Roby Joehanes

Field Summary
protected  java.util.Set[] parentTableCache
           
protected  short[][] tallyMatrix
           
protected  int total
           
protected  Table tuples
           
 
Fields inherited from class edu.ksu.cis.bnj.bbn.learning.score.SparseScore
arityCache, attributeSize, maxArity, nodes, totalRows, tupleSize
 
Fields inherited from class edu.ksu.cis.bnj.bbn.learning.LearnerScore
NO_CANDIDATES, owner, tally
 
Constructor Summary
DiscrepancyScore()
           
DiscrepancyScore(Learner l)
          Shielding Score constructor
 
Method Summary
 double getScore(int curNode, int candidate, java.util.Set[] parentTable)
          Get the score
 void initialize()
           
protected  void iterateUniqueInstantiation(int depth, Tally tally)
          Recursively filter out the data according to the current node
protected  int[] prepareNodes(int node, java.util.Set[] parentTable)
           
protected  void tallyPrecache()
           
 
Methods inherited from class edu.ksu.cis.bnj.bbn.learning.score.SparseScore
initializeCache
 
Methods inherited from class edu.ksu.cis.bnj.bbn.learning.LearnerScore
getTallyer, setData, setOwner
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

total

protected int total

tuples

protected Table tuples

tallyMatrix

protected short[][] tallyMatrix

parentTableCache

protected java.util.Set[] parentTableCache
Constructor Detail

DiscrepancyScore

public DiscrepancyScore()

DiscrepancyScore

public DiscrepancyScore(Learner l)
Shielding Score constructor

Parameters:
l -
Method Detail

tallyPrecache

protected void tallyPrecache()

prepareNodes

protected int[] prepareNodes(int node,
                             java.util.Set[] parentTable)

getScore

public double getScore(int curNode,
                       int candidate,
                       java.util.Set[] parentTable)
Description copied from class: LearnerScore
Get the score

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#getScore(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:
tally -

initialize

public void initialize()
Overrides:
initialize in class LearnerScore